Case affects Grand Total
I have a series of columns which I would need to add case statements but the issue is whenever I add case statement, the Grand Total is shown as '0' (zero).
When I take out the case statement, its fine.
Please help.
Try doing this:
1) Use a Pivot Table, not Table.
2) In the Measures section, for the column that contains the CASE statement, click on the box, and select Aggregation Rule>Sum and see if that gets you what you want.
Similar Messages
-
Hello,
Using obiee 11g,
I am trying to build a report where i am trying do a count(distinct un),so i created a logical column for that and using that in my answers.
The un i am showing for over months.IS works fine except that the grand total shows wrong.
Grand total just adds the months total and not just do a count distinct for un.
Aggregation rule is set as default.
Would like to know how to do this?
ThanksHello,
Its not working that way.
Let me explain my case in detail.Problem is only in case of GRAND TOTAl.
I am showing different cases,users and export for each month.
So cases and users are used everywhere so i created a logical column in the RPD.
count(distinct caseid) and count(distinct userid) as cid and uid and using that in my answers.
export count since not used everywhere initially i took that column into my answers and then did a count(xportcount) in my answers
so i have now
cid-uid-count(xportcount) as 3 columns in my answers.But here the problem is my Grand total for uid comes wrong.
Instead of doing a distinct users for all the months selected it just shows the grand total as sum for users
Like jan-16 users feb -17 users then the total is 16+17 and not the distinct users from jan and feb.
Grand total for case and exportcount is correct because i need a sum in that case so aggregation rule as deault works fine here.
Here the problem which i feel is the count distinct which i am doing for caseid and uid and not exportcount.
In my second scenario i did like created a separted column count(exportcount) in the rpd, then used that in my answers.
But still no use
In my third sceanario i created a count(distinct exportcount) in the rpd and using that in my answers
now it feels it works fine.
I wnat to know is this the way BI works.
I am bit confused now.
Is there a way other then this to do.
I wanted first,second sceanario also to work but doesnt feel like working is there a way to make it work?
Thanks -
Grand total of calculated column and case function in the same calcultd col
Hi Gurus,
In 9.0.4, the Grand total of the calculated column is not working as per the CASE function. It is taking the ELSE formula for all records. Is there a way to correct it.
Thanks,
PoojaHi Pooja,
In the totals ,which u mentioned try using cell sum function instead of sum function.
Manikandan
GKB Consulting Inc., -
Urgent:Grand total in hierarchical alv
I am printing a hierarchical alv with subtotals. I want to print the grand total for the whole numeric columns ...
Can anyone explain me how i can do this.
Thanks and regards,
SubhakarHi,
In this case you not only require the totals but the subtotals also.
For achieving this output you will have to sort the alv on the first column and also give subtotals there.
use
data: SORTF TYPE SLIS_SORTINFO_ALV,
TSORT TYPE SLIS_T_SORTINFO_ALV.
in the function module reuse_alv_grid_display give
it_sort = tsort.
eg:
FORM ALV_SHOW.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LAYOUT-BOX_TABNAME = 'IT_DISPLAY'.
LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
LAYOUT-ZEBRA = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = TCATALOG
IS_VARIANT = VAR1
I_SAVE = 'A'
IT_SORT = TSORT
IT_EVENTS = TEVENT[]
TABLES
T_OUTTAB = IT_DISPLAY.
ENDFORM . "ALV_SHOW
and write a subroutine for sort...
form sort.
CLEAR SORTF.
SORTF-spos = 1.
SORTF-fieldname = 'column_1'.
SORTF-tabname = 'IT_table used for display in alv'.
SORTF-up = 'X'.
SORTF-subtot = 'X'.
APPEND SORTF TO TSORT.
endform.
If this doesn't help I will send you the whole source of a sample program..
Abdullah -
How to get the Grand Total in Module pool Screen
Hi Frds.
How to get the Grand Total in Module pool Screen
Example i have 10 different materials
for each matarial has different moving . But in my case matarials is doesnt matter here
10 material Moving Average price to do Frand total and display in one column...
Please Help me out Frds.
Regards,
KabilHi
You need to calculate the total in a module of PAI (or PBO) event:
PROCESS PAI.
LOOP.....
ENDLOOP.
MODULE CALCULATE_TOTAL.
MODULE CALCULATE_TOTAL.
GRAND_TOTAL = 0.
LOOP AT ITAB,
GRAND_TOTAL = GRAND_TOTAL + ITAB-PWB.
ENDLOOP.
ENDMODULE.
In this way the grand total will be calculated as soon as the user presses enter or another command.
You can't insert the calculation in the loop of table control, because this loop runs the visible lines only, so it's better to calculate the total out of those loop, -
Hello,
I have one requirement where I want to show the data as follows
Type Metric Values
Type1 units 100
Days 50
% Calc 10%
Type2 units 100
Days 50
% Calc 10%
Type3 units 100
Days 50
% Calc 10%
Total units 300
Total Days 150
Total % Calc 30%
If I take grand total of row in pivot table, I am not able to show Total units, Total Days and Total % Calc values in Grand Total because by default, same grand total name appears.
I want to give different grand total names and percentage sign should appear in grand total.
Please let me know if u need any more information.
Thanks.Try to recreate the report. Just in case make sure that you dont have null values in that metric or try with ifnull(col,0)
Check this bug too BUG:9871470
Keep update -
How to set Grand Total of a Measure when its aggregation rule is Max in Logical Layer
Hi
I have a Measure Column (Budget) and in Logical layer the aggregation rule is set as (Max) which looks like Max(Budget). But now it is included in the report and when my client is trying to see its grand total, it is giving the Max Budget figure of the report rather than giving the total sum(grand total).
Kindly share some ideas in achieving the grand total without disturbing the actual aggregation of the measure.Thank You for your reply.
In my case i don't have a problem with aggregation for Budget Measure(max(Fact_XXKC_SHIP_TO_BUDGET_CAT_F.SALESREP_BUDGET_YTD)). This is the aggregation rule applied on the Salesrep Budget YTD.
Now i created a report with columns
Salesrepresntative(Dimension),, Sales Invoices(Measure1),, SALESREP_BUDGET_YTD(Measure 2).
In the above report the values are perfect, but when we used Grand total option at ROW level in table view, the grand total of Measure1 is cumulative of all the rows, but the Grand total of SALESREP_BUDGET_YTD (measure2) is the max of all the columns.
What i require is the Grand total of SALESREP_BUDGET_YTD (measure 2) should be cumulative of all the columns.
I have shared my SQL query, kindly verify it and share any idea.
select sum(case when T97600.W_XACT_TYPE_CODE = 'Chargeback' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c1,
sum(case when T97600.W_XACT_TYPE_CODE = 'Credit Memo' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c2,
sum(case when T97600.W_XACT_TYPE_CODE = 'Debit Memo' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE end ) as c3,
sum(case when T97600.W_XACT_TYPE_CODE = 'Standard Invoice' then T93664.NET_AMT * T93664.GLOBAL1_EXCHANGE_RATE when T97600.W_XACT_TYPE_CODE = 'Invoice Cancellation' then T93664.NET_AMT * -1 * T93664.GLOBAL1_EXCHANGE_RATE end ) as c4,
T315597.XXKC_RESOURCE_NAME as c5
from
W_CUSTOMER_LOC_USE_D T315597 /* Dim_W_CUSTOMER_LOC_USE_D_Status */ ,
W_SALES_INVOICE_LINE_F T93664 /* Fact_W_SALES_INVOICE_LINE_F */ ,
W_XACT_TYPE_D T97600 /* Dim_W_XACT_TYPE_D_Sales_Ivclns */
where ( T93664.XACT_TYPE_WID = T97600.ROW_WID and T93664.DELETE_FLG = 'N' and T93664.XX_SHIP_TO_LOC_USE_WID = T315597.ROW_WID )
group by T315597.XXKC_RESOURCE_NAME
) D1 full outer join (select max(T313184.SALESREP_BUDGET_YTD) as c1,
T315597.XXKC_RESOURCE_NAME as c2
from
W_CUSTOMER_LOC_USE_D T315597 /* Dim_W_CUSTOMER_LOC_USE_D_Status */ ,
XXKC_SHIP_TO_BUDGET_CAT_F T313184 /* Fact_XXKC_SHIP_TO_BUDGET_CAT_F */
where ( T313184.SITE_USE_WID = T315597.ROW_WID )
group by T315597.XXKC_RESOURCE_NAME -
How to get sub and grand total
Dear all, I have a report which combines the two totals together and and makes one formula. This formula then is filtered according to Group2 (Reason Code).
Group 1 is the same Reason Code however with Specified names. Group2 is the same reason code however with ascending order.
My question is how to make the sub total and grand total of this formula.
Detailed Information:
1: Total One - DistinctCount(Order_no),GroupName2 -- In this Total, the records are counted when Linetype = F
2: Total Two - DistinctCount(Order_no),GroupName2 -- In this Total, the records are counted when Linetype = S
Formula
Whileprintingrecords;
Numbervar x:=0;
Numbervar y:=0;
Numbervar z:=0;
x:={#FOCTC};
y:={#CREDITTC};
z:=x+y;
z;
Now this formula is placed in the footer of the Group2 (Reason Code).
What I would like to do is to have a Group2 Sub Total and Finally Grand Total.
I have tried the Following however it doesn't seem to be working.
I created another formula exactly like above and placed it into the same Group footer however removed the "Numbervar o:=0;" (The numbervar z:=0; in the above case however when I created another formula I created named the variable "o" instead of "z") so that it does not reset it.
Then I placed another formula into the Report Footer with the following code
Whileprintingrecords;
Numbervar o;
Any ideas?
Many thanks
Regards
JehanzebOk sorted, I used another formula like this.
Whileprintingrecords;
Numbervar TJGs;
Numbervar TotalJobs=0;
Numbervar CAvg=0;
TotalJobs := {@TotalFOCCR};
CAvg:= TotalJobs;
TJGs:=TJGs + CAvg;
CAvg
It sorted the issue. -
How to add one column value with grand total
hi,
this is my perform.i am just here multipling menge and gpres value and stores into G_total variable and displing into output.
this is my output in main window.
ex:mat. 1 77.00(g_total value)
mat 2 55.00(g_total value)
now the requirement is to add the column and display the output as grand total ex: 77.00 +55.00 = 132.00
how to do the syntax please help me......???
FORM get_total TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
DATA: lv_menge(20),
lv_gpreis(20),
g_total(20),
g_total1(20).
DATA:lc1 TYPE string,
lc2 TYPE string,
ls_tab TYPE itcsy,
l_tabix TYPE sy-tabix.
READ TABLE in_tab WITH KEY name = 'RESBD-MENGE'.
IF sy-subrc EQ 0.
lv_menge = in_tab-value.
ENDIF.
READ TABLE in_tab WITH KEY name = 'RESBD-GPREIS'.
IF sy-subrc EQ 0.
lv_gpreis = in_tab-value.
ENDIF.
REPLACE ',' INTO lv_gpreis WITH ''.
CONDENSE lv_gpreis NO-GAPS.
READ TABLE out_tab WITH KEY name = 'G_TOTAL'.
IF sy-subrc EQ 0.
g_total = lv_menge * lv_gpreis.
out_tab-value = g_total.
CONDENSE g_total.
lc1 = g_total+0(2).
lc2 = g_total+2(3).
CONCATENATE lc1 lc2 INTO g_total SEPARATED BY ','.
out_tab-value = g_total.
CLEAR ls_tab.
LOOP AT out_tab INTO ls_tab.
l_tabix = sy-tabix.
CASE ls_tab-name.
WHEN 'G_TOTAL'.
ls_tab-value = G_TOTAL.
MODIFY out_tab FROM ls_tab INDEX l_tabix.
ENDCASE.
ENDLOOP.>
asissahu wrote:
> hi.
>
> nobody is replying my question???
>
> please help me
Hi, Asissahu
Because may be some one have problem to read your code
Please have a look at the following link and past code this way.
[How to post code in SCN|How to post code in SCN, and some things NOT to do...;
@Naga Please you too
Regards,
Faisal -
Navigation of Grand total in pivot table
I’m currently working in report development Oracle BI wherein I need to develop a report using pivot table. I need to do summation at both row and column level and when clicked on the Grand Total level it should display entire resultset. According to the data clicked the filter condition is passed on to next level of report, but it displays no results at total level as the filter is passed as the same name ‘Grand Total’(column heading) instead of the actual values.
Any pointers on this would be helpful to us.i am experiencing the same proble.I hope you are creating calculated item and you are clciking on measure value corresponding to calculated item.In that case it will pass calculated item name to child report .Correct me if i am wrong.
I think it is not possible in that case to pass correct filters.Wait for others comments.
Regards,
Sandeep -
Good Day everyone,
I have created a report in Discoverer Desktop Edition (Release 4.1), at first, it shows the grand total for the Budget column but when I added a calculated columns “Actual Cost” and “year-to-date”, then the grand total no longer displays for the Budget column and it only shows total on columns for Actual Cost and Year-to-date.
Can anyone help me on this?
Thanks,
tonyHi,
Double check it below thinks:
1) check it measure columns have you setted Aggregation rule like None. if it's there then it won't show so please change it, then try it again
2) have you ever Moved measure columns to the "Rows" section of your pivot table
3) make sure Pivot table rows ---> rows agreation should not be none, change it and try it again.
if it's that case please share it u r current screen short.
Thanks
Deva -
Hi
I am using 10g.I have pivot table re[port. In this report 3 rows dimension and 4 measure values.
Now i set grand total based on row values.Grand total backround color dark blue display upto dimension row.After dimension sum(measures) shows normal color.
My requirment is i should display full row for grand total is dark blue.How can i set pls let me know?
Thanks
GramTry this
Rows at Sigma sign->Format Lables
Use Custom CSS Style->
background-color: #ECEFF3; color: black;
If works pls mark as correct :)
Just in case you want to use same color of above values use
color: #3C3C3C; instead of color: black;
Edited by: Srini VEERAVALLI on Jan 9, 2013 9:52 PM
BTW: For your other post "Pivot Col Heading " can you send me screenshot to my email
Edited by: Srini VEERAVALLI on Jan 9, 2013 9:55 PM -
Hello Guys,
I have a situation...
I am using Pivot View for a report (the reason being...I need the data by month in sections....)...
I need total for each section so I used the Sum button of Rows for grand total of each section (again the reason being....if I used Sum of Sections...it will display another section as 'All sections' which is nothing but all the entries clubbed into one table.....which is not desirable in my case)..
So, I almost have what I want..the only thing I would require is the Grand total of all the Grand totals at the bottom....
Can anyone help me please.....I tried many ways...but couldn't get it.....Thanks friend....I got it...
only problem I faced while fixing this was...The grand total formatting...I had to customize it as I didnt find a way to hide the measure grand total...
what I mean is....after hiding the details,etc...I was left with only one row..which is the calculated column 'Grand Total',....but it was just as any other row...(i.e.,) without any formatting...default background and font...
but when I clicked on 'Sum' for the 'Row'.....it showed me the actual Grand Total which means ...with formatting...but then....there were 2 rows now.....so I removed the 'Sum' and manually did the formatting to match with the other Grand Totals.....this was a workaround....let me know if there is any better solution...
Thanks anyways for the solution.... -
Grand total on a calculated item
Hi,
I have a crosstab report in discoverer plus 10g. I need to show total at the bottom for two calculated columns, report looks something like below
COMPANY Beginning Bal Ending Bal Net Amount
1457 $35,467.90 $39,875.87 $359
- - - $453
- - - $564
- - - $347
- - - $234
1568 $65,893.56 $76,594.87 $674
- - - $564
- - - $536
- - - $538
- - - $364
- - - $392
Grand Total
Net amount is a datapoint, but the beginning balance and ending balance are the calculated items in the report. is it possible to show the total for these calculated items? Please let me know if this is possible.
Thanks,
Nivas.Hi,
Thanks for the reply.
I have tried with cell sum but it is not displaying any total.
beginning balance is a calculated item which is not based on any aggregated function
beginning balance =
CASE WHEN "ROW NUM" = "Max Row Num" THEN "worksheet".Beg Bal ELSE TO_NUMBER('') END
same is the calculation for ending balance.
I have account, company, beg bal, end bal, net amount to be displayed in the report.
when I do cell sum by company every thing is fine, i get the totals displayed, but when i try with account then no totals are displayed in the report.
please let me know if I am missing some thing.
Thanks,
Nivas. -
Hide column result in pivot grand total row
Hello
Do you know if it is possible to hide the result of a particular column in a pivot grand total row?
I have several columns to which makes sense use a grand total row (as in a sum) but for others (such as average) it does not make sense in the light of the client business rules.
Any help on this matter is highly appreciated :)
Thanks in advance,
J MarquesI have a measure that represents the average time according to the dimensions it uses - and that works properly.
However, the grand total for that column shows me the average of the average times above. This is not correct that is why I want to hide it.As said by kishore, In pivot go to that time average time column -> Aggregation rule -> None, This won't affect the column avg value.
The grant total value will not come.
By setting this, are you getting wrong values?
Thanks,
Vino
Maybe you are looking for
-
After Effects CC 2014 only using 30% of CPU when rendering
I've scoured the internet for details but there's surprisingly little help when it comes to After Effects and performance. Basically, I built a new workstation awhile ago with the hopes of really speeding up my video editing as I was starting to do a
-
Hi! Experts, Can you please tell me the Number Range for Depreciation Post? My problem is: When I keep Number Range as internal, system not allow me to post the depreciation and give the following error at the time of Test Run: Create document number
-
I need to change my server so I can do a software update on my mac but I can't get rid of it.
I've tried everything to change the server but it won't.
-
What video cards will the p7-1423w support?
I would like to upgrade my video graphics to something that will support Witcher 2. I picked up a video card but then realized the power consumption is too great for this pc. Any suggestions on what card I can get that will support this type of gra
-
How to overcome Error 1402 on Reader 9.3 installation?
I am getting Error 1402 attempting to install Reader 9.3. It points to registry problem in Hkey_Local_Machine\Software\Microsoft\Windows\Current version\Run\Optional Components\IMAIL I have read instructions to correct error 1402 but I am still havi