Specific aggregation for Grand total
Hi all,
Is it possible to specify a function instead of the provided list of aggregation rules in answers or in the rpd.
I'd like to calculate SUM(Xi)/SUM(count(Xi)) and display it as a grand total
__________Column X
___________10
___________20
___________30
Grand total 20 (60/3=20)
Regards
what is the grand total formula you are expecting?
if you post it here we can sort it out.
You can find the 'Combine with similar Request' option in the criteria.
click on that and select your subject area and select the exact columns you used in your report. Now in this report change the formula to the one you want.
in your first column delete the formula and simply type 'Grand Total' and in the second column type
sum(column_name)/count(column_name)
you can ref to this link. just take how they are using 'UNION' request in the example. Though the link is not totally relevant to you it will help you.
http://oraclebizint.wordpress.com/2008/01/25/oracle-bi-ee-101332-dynamic-column-headers-using-presentation-variables-sets-and-conditional-formatting/
Similar Messages
-
Currency symbol only for grand total.
Hi,
My requirement is i want currency symbol $ only for grand total, all the rows in that column do not have the symbol.
I need some your help.
Thank you.Although I couldn't understand why you dont want currency format in rows, here is my suggestion.
Create your report as
1 dim1.column1 dim2.column2 Measure.Revenue ......... You will get values as below
1 Value1 Dim2Val1 100
1 Value2 Dim2Val2 200
1 Value2 Dim2Val3 300
UNION
2 'Grand Total' ' ' Measure.Revenue
Final result will be as below
1 Value1 Dim2Val1 100
1 Value2 Dim2Val2 200
1 Value2 Dim2Val3 300
2 Grand Total 600
Now apply conditional formatting for dim1.column1 in criteria and make the values Bold
Apply conditional formatting for Measure.Revenue and select Currency in number format.
Let me know if it was helpful or you were looking for something else.
Thanks -
ALV GRID - Text for Grand Total
Hi guys,
In ALV Grid, i need to display the Text 'GRAND TOTAL' at the left side of the row(Yellow line).
I have tried searching in the forum but didn't get the answer.
Please advice.
Thanks
ChintuHi
<br><br>
IF you copy and past this might not work but this is the sample code<br><br>
<pre>
REPORT Y_DOWN_TIME_ENTRYSRA.
TABLES : YDOWNTIME1.
TYPE-POOLS : SLIS.
*INTERNAL TABLE DECLARTION
data : l_layout type slis_layout_alv,
x_events type slis_alv_event,
it_events type slis_t_event.
DATA :ITAB LIKE YDOWNTIME1 OCCURS 0 WITH HEADER LINE .
data : GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
wa_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
**********************SELECTION PARAMETERS ************************
PARAMETERS: CB1 RADIOBUTTON GROUP G1 ,
CB2 RADIOBUTTON GROUP G1 ,
cb3 RADIOBUTTON GROUP G1 ,
CB4 RADIOBUTTON GROUP G1 ,
CB5 RADIOBUTTON GROUP G1 ,
CB6 RADIOBUTTON GROUP G1 ,
CB7 RADIOBUTTON GROUP G1 ,
CB8 RADIOBUTTON GROUP G1 ,
CB9 RADIOBUTTON GROUP G1 .
CB10 RADIOBUTTON GROUP G1,
CB11 RADIOBUTTON GROUP G1.
DATA : A TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS :S_EQUNR FOR YDOWNTIME1-EQUNR ,
S_ERDop FOR YDOWNTIME1-ERDAT,
S_MFSTT FOR YDOWNTIME1-MFSTART.
PARAMETERS : P_SHIFT TYPE YDOWNTIME1-SHIFT,
P_CHARG TYPE YDOWNTIME1-CHARG,
p_COGRU TYPE YDOWNTIME1-QMGRP,
P_CODE TYPE YDOWNTIME1-COde,
p_name type ydowntime1-OPNAME,
p_sup TYPE YDOWNTIME1-SUPERVISOR,
P_MANG TYPE YDOWNTIME1-MANG.
SELECTION-SCREEN END OF BLOCK BK1 .
AT SELECTION-SCREEN.
IF CB1 EQ 'X'.
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop .
ELSEIF CB2 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and charg eq p_charg .
ELSEIF CB3 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and charg eq p_charg and shift eq P_SHIFT .
ELSEIF CB4 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where code eq p_code and erdat in S_ERDop.
ELSEIF CB5 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and EQUNR in S_EQUNR and QMGRP eq p_COGRU.
ELSEIF CB6 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where OPNAME eq p_name and erdat in S_ERDop.
ELSEIF CB7 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where SUPERVISOR eq p_sup and erdat in S_ERDop.
ELSEIF CB8 EQ 'X' .
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where MANG eq p_MANG and erdat in S_ERDop.
ELSEIF CB9 EQ 'X'.
select * from YDOWNTIME1
INTO CORRESPONDING FIELDS OF TABLE ITAB
where erdat in S_ERDop and EQUNR in S_EQUNR.
endif.
loop at itab.
if itab-schno > 1.
A = ' '.
move A to itab-DCOR .
move A to itab-DCCR .
move A to itab-DCNR .
modify itab.
endif.
endloop.
perform create_fieldcat.
data: sort type slis_sortinfo_alv,
it_sort type SLIS_T_SORTINFO_ALV.
sort-fieldname = 'EQUNR'.
sort-up = 'X'.
sort-subtot = 'X'.
APPEND sort to it_sort.
sort-fieldname = 'SHIFT'.
sort-up = 'X'.
*sort-subtot = 'X'.
APPEND sort to it_sort.
l_layout-TOTALS_TEXT = 'TOTAL'.
l_layout-SUBTOTALS_TEXT = 'SUBTOTAL'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = gt_fieldcat
it_events = it_events
it_sort = it_sort
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form CREATE_FIELDCAT
text
--> p1 text
<-- p2 text
FORM CREATE_FIELDCAT .
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '1'.
LS_FIELDCAT-FIELDNAME = 'ERDAT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Date'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'UZEIT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '8'.
LS_FIELDCAT-SELTEXT_L = 'Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'EQUNR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '8'.
LS_FIELDCAT-SELTEXT_L = 'Equipment'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '2'.
LS_FIELDCAT-FIELDNAME = 'CODE'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
LS_FIELDCAT-SELTEXT_L = 'CODE'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '3'.
LS_FIELDCAT-FIELDNAME = 'QMGRP'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Code Group'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '3'.
LS_FIELDCAT-FIELDNAME = 'KURZTEXT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '40'.
LS_FIELDCAT-SELTEXT_L = 'Code Text'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '7'.
LS_FIELDCAT-FIELDNAME = 'DCOR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '14'.
LS_FIELDCAT-SELTEXT_L = 'Opening Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '8'.
LS_FIELDCAT-FIELDNAME = 'DCCR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '14'.
LS_FIELDCAT-SELTEXT_L = 'Closing Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'DCNR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Net Dips'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'PRO'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'PROD IN LAC'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '4'.
LS_FIELDCAT-FIELDNAME = 'CHARG'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '12'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'Batch Number'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'OPNAME'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Operators Name'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'SUPERVISOR'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Supervisor Name'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'MANG'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Manager'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '6'.
LS_FIELDCAT-FIELDNAME = 'SHIFT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '20'.
LS_FIELDCAT-SELTEXT_L = 'Shift'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'MFSTART'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'Start Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'MFEND'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'End Time'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'DURATION'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
ls_fieldcat-do_sum = 'X'.
LS_FIELDCAT-SELTEXT_L = 'DURATION'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
CLEAR LS_FIELDCAT.
LS_FIELDCAT-ROW_POS = '1'.
LS_FIELDCAT-COL_POS = '9'.
LS_FIELDCAT-FIELDNAME = 'ZUNIT'.
LS_FIELDCAT-KEY = ''.
LS_FIELDCAT-OUTPUTLEN = '10'.
LS_FIELDCAT-SELTEXT_L = 'UNIT'.
APPEND LS_FIELDCAT TO GT_FIELDCAT.
clear LS_FIELDCAT .
ENDFORM. " CREATE_FIELDCAT
</pre>
Edited by: Matt on Sep 3, 2009 12:06 PM -
*urgent* Alternate colors for Grand total values
Hi all,
I have 1 dimension column and 4 fact columns. Here I perform Grand total for the request .
The requirement is :---
I need alternate colors as background for the Grand total values.
Am trying to modify the XML in Advanced tab .
I tried to do it by using combine request .
Please help on this . Urgent .
Thanks a lot in advance for every reply .Please give some suggestions.
-
Alternating colors for grand total values
hii
i hve a requirement that grandtotal values should be displayed in alternate colors..actualy grand total values be in blue..bt i need the alternate colors for the values of grand total..pls help me regarding this..Please give some suggestions.
-
I have created an expanding table, using the following link:
http://forms.stefcameron.com/2009/02/25/expandable-table-with-totals/
(instructions shown below)
However, I have been unsuccessful with the Grand Total value. As shown in the picture below, the rest of the totals show but the Grand Total remains blank. I must include the Installation fee (marked by the check box)
This is the last step needed to complete my form, I would really appreciate all the help i can receive.
Thank you!Row1[x] (where x is an integer) is the name and subscript for your rows. In the example, Stef (if that's his real name) used Item as the name for his rows. In your form, you are using Row1. So, each row is named Row1[0], Row1[1], Row1[2], etc... Inside of each Row1, you have a text field called "Total." Since you're using formCalc, you are summing the total of those rows using Row1[*].Total. So, if you haven't changed anything else, you should (at the very least) be able to sum the rows in the grand total box using
$.rawValue = Sum(Row1[*].Total)
Now, the checkbox is a different story. The checkbox has an "on" value and an "off" value. We can use that in formCalc to more easily add it to the value that we're going to get for the grand total. If you set the "on" value to 300 (I included an illustration of that in my first picture), then you can use the name of the checkbox to get your total. If the checkbox is checked or "on", then the on value (300 in my example) gets added to the total, and if it's unchecked or "off", then the off value (0 in my example) gets added. The checkbox also has to have it's name correct. In my example it's called CheckBox1, in your code you have Installation. So, whatever you named the checkbox needs to go at the end of the formula we're using like so.
$.rawValue = Sum(Row1[*].Total) + Installation
If you named your checkbox something else, then you'll need to change the word "Installation" to whatever the checkbox is named. (The name is in the hierarchy tree.) -
How to summarize the formula field for grand total
Hi All
Iam desinging a report in which iam facing a problem to summarize the formula field . This formula field contains sum calculation like
formula name is @sales
Sum ({@DTM200}, {@SaleMan})+Sum ({@DTM500}, {@SaleMan})+
Sum ({@TM500}, {@SaleMan})+Sum ({@TM1000}, {@SaleMan})+
Sum ({@HTM500}, {@SaleMan})+Sum ({@HTM1000}, {@SaleMan})+
Sum ({@WM500}, {@SaleMan})+Sum ({@WM1000}, {@SaleMan})+
Sum ({@CURD}, {@SaleMan})+Sum ({@Buttermilk}, {@SaleMan})+
Sum ({@BULKWM}, {@SaleMan})+Sum ({@BULKTM}, {@SaleMan})
the fields are summary fields and iam calculating all these fields to get the final result . Upto this it is working fine but finally i want to calculate the grand total of this formula '@sales' how should do this
Thanks in advanceHi,
If your formula name is @Sales you click the @Sales formula then Click Insert from Menu bar and click Summary.
Then click Grand Total.
Regards,
Clint -
Hi guys.
I've been trying to summarize a bunch of rows, but I'm having a little trouble doing that.
I have few nested queries which I show below:
SELECT DATA, SAP, SADIG, DIFF
FROM (SELECT TMPSAP.DATSAP as DATA,
TMPSAP.VALSAP as SAP,
TMPSADIG.VALSADIG as SADIG,
ABS(TMPSAP.VALSAP - TMPSADIG.VALSADIG) as DIFF,
GROUPING(TMPSAP.DATSAP) AS GRUPO
FROM (SELECT SUM(ZVLBRT) + SUM(ZDESVP) as VALSAP,
TO_DATE(SPTAG, 'YYYYMMDD') as DATSAP
FROM SAPR3.S974@PRD
WHERE VKORG = '1000'
AND (TO_NUMBER(SPART) BETWEEN 10 AND 55 OR SPART = '99')
AND KUNNR <> 1004
AND TO_DATE(SPTAG, 'YYYYMMDD') BETWEEN
TRUNC(TRUNC(SYSDATE, 'DD') - 1, 'MM') AND
TRUNC(SYSDATE, 'DD') - 1
GROUP BY SPTAG) TMPSAP,
(SELECT SUM(FATDEVVLR) as VALSADIG, DATFATDEV as DATSADIG
FROM SADIG_FATDEV
WHERE BUCDG = 01
AND DATFATDEV BETWEEN
TRUNC(TRUNC(SYSDATE, 'DD') - 1, 'MM') AND
TRUNC(SYSDATE, 'DD') - 1
GROUP BY DATFATDEV) TMPSADIG
WHERE TRUNC(TMPSAP.DATSAP, 'DD') = TRUNC(TMPSADIG.DATSADIG, 'DD')
GROUP BY GROUPING SETS((DATSAP, VALSAP, VALSADIG),())) ALLDATA
GROUP BY ROLLUP(ALLDATA.GRUPO, ALLDATA.DATA, SAP, SADIG, DIFF)
I'm having some trouble figuring out which GROUP BY attributes I should use for the outter query, so the results I get are like these:
DATA
SAP
SADIG
DIFF
01/08/2013
1000
2000
1000
01/08/2013
1000
2000
01/08/2013
1000
01/08/2013
02/08/2013
1000
1000
0
02/08/2013
1000
1000
02/08/2013
1000
02/08/2013
03/08/2013
2000
3000
1000
03/08/2013
2000
3000
03/08/2013
2000
03/08/2013
05/08/2013
5000
5000
0
05/08/2013
5000
5000
05/08/2013
5000
05/08/2013
06/08/2013
1000
2000
1000
06/08/2013
1000
2000
06/08/2013
1000
06/08/2013
If you look at my second select layer (the one that returns ALLDATA), my results are like these:
DATA
SAP
SADIG
DIFF
GRUPO
01/08/2013
1000
2000
1000
0
02/08/2013
1000
1000
0
0
03/08/2013
2000
3000
1000
0
05/08/2013
5000
5000
0
0
06/08/2013
1000
2000
1000
0
1
And what I want is this:
DATA
SAP
SADIG
DIFF
01/08/2013
1000
2000
1000
02/08/2013
1000
1000
0
03/08/2013
2000
3000
1000
05/08/2013
5000
5000
0
06/08/2013
1000
2000
1000
10000
13000
3000
I've tried several combinations in ROLLUP, but without success. What am I missing?
Thank you very much!
Best regards,
ViniciusHi, Frank! Thank you for your quick reply.
Just for reference, all my queries are running under Oracle 9.2.0.1.0, unless otherwise specified.
First of all, I'm sorry if I wasn't clear. I tried to provide as much information as possible, so I think I might have made things a little fuzzy.
Also, it's my very first post in this forum, so I'm not really used to oracle community standards - and I apologize for that.
Moving on, unfortunately, I'm a little way too much confused, so I don't know exactly a good way to simplify my problem, so going a little against of your advice, I'll dig a little deeper and unravel the matter in unitary steps. Also, unfortunately I can't provide CREATE TABLE or INSERT statements, since I really don't know what the whole structure behind the databases is. What I can is to provide a few CREATE TABLE and INSERT statements regarding step 2 and forward, so you could at least reproduce the situation. Here's the SQL:
CREATE TABLE TMPSAP (DATSAP DATE NOT NULL, VALSAP NUMBER (8,2) NOT NULL);
CREATE TABLE TMPSADIG (DATSADIG DATE NOT NULL, VALSADIG NUMBER (8,2) NOT NULL);
INSERT INTO TMPSAP VALUES(TO_DATE('01/08/2013','DD/MM/YYYY'), 300);
INSERT INTO TMPSAP VALUES(TO_DATE('02/08/2013','DD/MM/YYYY'), 1000);
INSERT INTO TMPSAP VALUES(TO_DATE('03/08/2013','DD/MM/YYYY'), -500);
INSERT INTO TMPSAP VALUES(TO_DATE('05/08/2013','DD/MM/YYYY'), 5000);
INSERT INTO TMPSAP VALUES(TO_DATE('06/08/2013','DD/MM/YYYY'), 1200);
INSERT INTO TMPSAP VALUES(TO_DATE('07/08/2013','DD/MM/YYYY'), 1800);
INSERT INTO TMPSADIG VALUES(TO_DATE('01/08/2013','DD/MM/YYYY'), 100);
INSERT INTO TMPSADIG VALUES(TO_DATE('02/08/2013','DD/MM/YYYY'), 1000);
INSERT INTO TMPSADIG VALUES(TO_DATE('03/08/2013','DD/MM/YYYY'), -500);
INSERT INTO TMPSADIG VALUES(TO_DATE('05/08/2013','DD/MM/YYYY'), 5000);
INSERT INTO TMPSADIG VALUES(TO_DATE('06/08/2013','DD/MM/YYYY'), 1200);
INSERT INTO TMPSADIG VALUES(TO_DATE('07/08/2013','DD/MM/YYYY'), 1800);
COMMIT;
Other than that, let me try it again:
I have two tables in two different systems which should have the same sum of values for one of their fields, given a date.
Step 1:
To check that, I have one query in one of those tables (which I'll call TMPSAP for now), which is running under Oracle 9.2.0.7.0 and accessed via DBLINK, that sums all the values and group them per date:
SELECT TO_DATE(SPTAG, 'YYYYMMDD') as DATSAP, SUM(ZVLBRT) + SUM(ZDESVP) as VALSAP
FROM SAPR3.S974@PRD
WHERE VKORG = '1000'
AND (TO_NUMBER(SPART) BETWEEN 10 AND 55 OR SPART = '99')
AND KUNNR <> 1004
AND TO_DATE(SPTAG, 'YYYYMMDD') BETWEEN
TRUNC(TRUNC(SYSDATE, 'DD') - 1, 'MM') AND
TRUNC(SYSDATE, 'DD') - 1
GROUP BY SPTAG
ORDER BY DATSAP
Which returns:
DATSAP
VALSAP
01/08/2013
300
02/08/2013
1000
03/08/2013
-500
05/08/2013
5000
06/08/2013
1200
07/08/2013
1800
Step 2:
Likewise, I have another query running in the other system's tables (which I'll call TMPSADIG for now), that sums all the values and group them per date:
SELECT DATFATDEV as DATSADIG, SUM(FATDEVVLR) as VALSADIG
FROM SADIG_FATDEV
WHERE BUCDG = 01
AND DATFATDEV BETWEEN
TRUNC(TRUNC(SYSDATE, 'DD') - 1, 'MM') AND
TRUNC(SYSDATE, 'DD') - 1
GROUP BY DATFATDEV
ORDER BY DATSADIG
Which returns:
DATSADIG
VALSADIG
01/08/2013
100
02/08/2013
1000
03/08/2013
-500
05/08/2013
5000
06/08/2013
1200
07/08/2013
1800
Step 3:
I run a query (which I'll call ALLDATA for now) in those two tables, joining them by date and calculating the difference between the values:
SELECT TMPSAP.DATSAP as DATA,
TMPSAP.VALSAP as SAP,
TMPSADIG.VALSADIG as SADIG,
ABS(TMPSAP.VALSAP - TMPSADIG.VALSADIG) as DIFF,
GROUPING(TMPSAP.DATSAP) AS GRUPO
FROM TMPSAP, TMPSADIG
WHERE TRUNC(TMPSAP.DATSAP, 'DD') = TRUNC(TMPSADIG.DATSADIG, 'DD')
GROUP BY GROUPING SETS((DATSAP, VALSAP, VALSADIG),())
ORDER BY TMPSAP.DATSAP
Which returns:
DATA
SAP
SADIG
DIFF
GRUPO
01/08/2013
300
100
200
0
02/08/2013
1000
1000
0
0
03/08/2013
-500
-500
0
0
05/08/2013
5000
5000
0
0
06/08/2013
1200
1200
0
0
07/08/2013
1800
1800
0
0
Step 4:
And now I need to run a mysterious query in ALLDATA (results above), that will return me these exact results:
DATA
SAP
SADIG
DIFF
01/08/2013
300
100
200
02/08/2013
1000
1000
0
03/08/2013
-500
-500
0
05/08/2013
5000
5000
0
06/08/2013
1200
1200
0
07/08/2013
1800
1800
0
Total:
8800
8600
200
Which means, I need to add a row in the end of the query, containing the sum of all previous rows (the one in red). I've been messing around with ROLLUP and other grouping functions, but I couldn't really manage to achieve anything even close to that.
Of course I could run the query again and sum everything and union all, or even run this from a stored procedure and summarize with some coding, but the point of my whole thread is: Is there any way to do that using nothing more than a query?
I hope I clarified what I'm looking for and I apologize if it is still unclear or too messy, but I really can't find another way to present the information.
And I also hope someone can help me find a way to do that.
Thank you very much!
Kind regards,
Vinicius -
Customizing grand total columns in pivot view
Hi,
I need to customize grand total column name in pivot view
ex: If i have two measure order quantity and order amount when i am selecting aggregation after in column properties it is getting grand total i need to display as grand total for OQ and grand total for OA
Please give suggestions
Thanks,
Kartheek.
Edited by: 998231 on May 26, 2013 11:31 PMHi Kartheek,
In Pivot View, the default Grand Total can not be renamed to have measure specific grand total labe (The one which we specify in the pivot view either by row or column).
But you can try having one seperate measure (in criteria) which will calculate the grand total of each measure by dimensions, which are available on the report.
In sort you can achieve this using table and narrative view together (Not by pivot view).
Expresion to be used for grand total in report criteria is Sum( Measure By Dim1, dim2... DimN)
where Dim1 and dim2 are the dimesional column available on the report and measure is you OQ/OA.
Create a table view as a default view (do not add any report level agg) and then add narrative view to display the Grand total OQ and Grand Total OA. You can add your custom lables with HTML tag, disply the 1st row only as the values will be repeated for grand total.
If you find any other solution do let me know. As of now I can think of this as a best solution.
Regards,
Kashi -
Hi,
My question is: Can I exclude grand total on some measure column in pivot view?
For example I have 3 columns.On columns Account1 and Accounts, aggregation is SUM, and on column Max(something), aggregation is MAX.
I have next situation.
Account1 Account 2 Max(something)
100 200 23
200 250 13
150 300 42
450 750 42 - GRAND TOTAL
But I want grand total only on columns Account1 and Accounts. For column Max(something) I don't want total at all.
Thank you for your replies.Hi,
Thanks for your reply,
According to the link Below
http://gerardnico.com/wiki/dat/obiee/answer_xml,
We can able to change color for Grand total through XML, but the example is in 10g, there is nothing call saw:totalValues in 11g Currently, may be it is replaced with saw:displayGrandTotal, I tried that option also but it is not working.
Is there anything which we can do through xml, to achieve the above requirement?
Thanks
Anirban -
Grand Total formula different from Subtotals
Hi,
i've a question. Suppose i have a normal table (No pivot) with 2 columns: Month and Salary percentage on Month.
In addition i have subtotals on Month column and a Grand Total. I have a situation like this:
Month Salary percentage on Month
30
January 20
50
January Subtotal 100
20
February 70
10
February Subtotal 100
Grand Total 200
In Salary percentage on Month field I have as aggregation rule Sum because i want that subtotals are the sum of single rows of the month.
But i don't want this for grand total. It should be 100 (max of subtotals).
Is it possible specify a different formula for Grand Total respect to that used for Subtotals?
Thanks
GiancarloIf your formula already contains any summarized fields then you cannot summarize that formula. Try creating a mannual running total like this
whileprintingrecords;
numbervar i;
i:=i+@formula;
Now place this formula in group footer or header and suppress this formula. Create a new formula like
whileprintingrecords;
numbervar i;
Place this in report footer which shows the grand total.
Reagrds,
Raghavendra -
Time Format (Grand Total) in OBIEE 11g
Experts,
In my Report Talk Time and Delay Time are present and I have enable the Grand Total based on Agency.
i.e.
Agency - Talk Time - Delay Time
AgencyA 00:05:10 00:00:02
AgencyB 00:02:12 00:00:01
AgencyA 00:15:13 00:00:02
AgencyC 00:10:10 00:00:25
GrandTotal 00.00:32.00:45.00 00.00:00.00:35.00
Look at Grand Total is shows like *00.00:32.00:45.00 ; 00.00:00.00:35.00*
But our requirement should be *00:32:45 00:00:35* for Grand Total.
Please let me know your valuable suggestions.
Thanks,
Balaa...Hi bala,
Tricky one and good question,never tried this or got this type of requirment.
did you aggregate the talk_time and delay_time,if so what is it ?? or did you use it as default one.
Play with it like using server aggregation so it would determine the correct totals i suppose.
hope helps you.
Note:- If you get any solution or work around please post here so we could also learn & looking forward for other experts go on it.
UPDATED POST
Instead of sum as aggregate can you try server complex aggregation so server would decide how it would handle or
even the max or min function .....its just playing with it to get a solution and check the query generated and run at the backend and see how the results are coming.
Cheers,
KK
Edited by: Kranthi.K on Apr 18, 2011 2:08 AM -
Sub total wise Grand total in ALV report
Dear All,
I am displaying a list of material through material group wise so for each material i want to display sub-total for stock and grand total of stock(material group wise).Here it is adding up all the stock displayed for different AUOM(alternative unit of measure ) which is for same material so i want to pick only the sub-total and sum up in my Grand total.
How to pick only the Sub-total Results and Add in ALV List for Grand total.
Thanks & Regards,
Arun.
Edited by: Arun Kumaran on Sep 24, 2008 7:46 AMHi arun,
check these links
total and subtotal in alv
ALV SUBTOTAL
Regards,
Anirban -
Obiee 11G - Show grand total in chart
I have three measures in my table.
Measure 1 - Rolling balance from the current and previous month.
Measure 2 - PeriodRolling revenue for the last three months including current month
Measure 3 - Calculation using measure 1 and measure 2 and the number of days.
I have created all three measures in the RPD.
The table is by state. So it could be Texas, New York, Illinois and so on.
Month
State
Measure 1
Measure 2
Measure 3
1
Texas
17565
9898989
45
1
New York
97848
8748575
43
2
Texas
85768
8734874
33
2
New york
94855
3234442
23
The chart shows the trend of Measure 3 by time for each state. I need a line on the chart to show the total by month. Do I have to create a sum() formula in the RPD? Appreciate any ideas that you can throw at me.I created a new group in the selection step and included all the states in it. That seemed to work. The Graph shows a line for grand total. Thank you for your help.
The requirement is to create a line chart. I don't think a bar would work as well here. -
Wrong SSAS Grand Total Value Monthly Value base on Weekly Value
Dear All,
I Have calculated measures in my cube base on Weekly and Base on Monthly and different
Template Base .
For grand Total Weekly is fine but for Monthly is bad one.
Say calculated Measure Name "Weekly" with Syntax
CREATE MEMBER CURRENTCUBE.[Measures].[Weekly]
AS IIF(isempty([Measures].[Actual Quantity MTD]) or [Measures].[Actual Quantity MTD]=0 or isempty([Measures].[Original Plan Quantity MTD]) , null ,
IIF([Measures].[Original Plan Quantity MTD] =0 or isempty([Measures].[Original Plan Quantity MTD]),null,
IIF(
([Measures].[Actual Quantity MTD]-[Measures].[Original Plan Quantity MTD]) > 0 , 1 ,[Measures].[Actual Quantity MTD]/ [Measures].[Original Plan Quantity MTD] )))
The Result is good
here the picture
http://hpics.li/9fd22f2
https://drive.google.com/open?id=0ByY5H-XcydgiWGp0RzdWYWp0M2c&authuser=0
and for Monthly Calculation it was AVG of Weekly base on Time, Plant, and PSL Dimension
My calculated Monthly Measure Name "Monthly" with Syntax
CREATE MEMBER CURRENTCUBE.[Measures].[Monthly]
AS AVG (
DESCENDANTS([PSL].[PSL Description])*
DESCENDANTS([Plant].[Plant])*
DESCENDANTS([Finish Date].[Calendar],[Finish Date].[Calendar].[Month Year])
, AVG(([Finish Date].[Calendar].CURRENTMEMBER.CHILDREN), [Measures].[Weekly]))
The Result is Bad on Grand total
here the Picture link
http://hpics.li/5233b50
https://drive.google.com/open?id=0ByY5H-XcydgicEhtT1FpekRsbW8&authuser=0
Please help me why for the Result doesn't same. What do i Miss
Thank You
YanHi Yan,
According to your description, you create a calculated measure in your cube, the problem is that grand Total for Monthly is incorrect, right?
In your scenario, the issue can be caused by that you used "*" and "/" in your calculated measure. In SSAS, one of the most common issues faced in mdx is grand total or sub total not coming properly when some arithmetic operations like
measure1 [* or + or - or /] measure2 is used, please refer to the link below to see the details.
http://vnu10.blogspot.jp/2011/01/mdx-grand-total-sub-total.html
Regards,
Maybe you are looking for
-
What is the best way to connect two monitors to MacBook Air?
I have a MacBook Air and I want to connect two monitors to it (not Thunderbolt Displays). I was thinking about using a Mini DisplayPort to DVI adapter to connect one monitor and a USB to DVI adapter to connect the other (such as Diamond BVU). But I h
-
I've lost the "Send" button in my reply window. When I double click on a Mail message, on order to reply, the "Send" button at the top of the window is missing. I can reply by closing and saving my reply, and re-openning from Drafts. How to fix?
-
Smc Usertoolbox and smuser/smrole do not work
Hi all, I am trying to use smuser and smrole (or alternatively the according tollbox within smc). If I call smuser, I get the following: # smuser list -- Authenticating as user: root Type /? for help, pressing <enter> accepts the default denoted by [
-
Discverer Report Selecting 85M records
Hi, Oracle Discoverer - 4.1 I have a discoverer report, which will selecting aroung 85 Million Records. While Running this report in Desktop, it takes arounnd 3 hours and still not populating any data. The CPU usage in the client goes to 100% and des
-
Extension Manager CS5 doesn't recognize DW CS5
I have installed CS5 premium on mac 10.6.3. Have reinstalled the extension manager. Even if I open the Extension Manager from DW, it doesn't list it. Please help.