Get Grand total of the subtotals
Hi,
I am devoloping a report which pulls the expense lines for each project.I am displaying the fte count at each line.As it'll be same for a particular project,all the lines for that particular project will show the same FTE count.I am grouping the
lines by Project No in Desktop edition.Now I want the total fte count which is the sum of the fte counts at each grouped level.So I cant use the total as it'll give the grand total of all the line entries.But I am not finding any option for this kind of total.(Total of the subtotals)
Pls give me a solution ASAP
Hi,
I am devoloping a report which pulls the expense lines for each project.I am displaying the fte count at each line.As it'll be same for a particular project,all the lines for that particular project will show the same FTE count.I am grouping the
lines by Project No in Desktop edition.Now I want the total fte count which is the sum of the fte counts at each grouped level.So I cant use the total as it'll give the grand total of all the line entries.But I am not finding any option for this kind of total.(Total of the subtotals)
Pls give me a solution ASAP
Similar Messages
-
How to display subtotals in every page and the grand total in the last page
Hello Abapers,
I am working with Smartforms. I am not able to print the subtotal in every page ie the Price for that particular page alone should be summed and in the final page I want the grand total also to be displayed. I tried the Total option in the Calculations tab but the value is just getting incremented on every page..How can I achieve this..
With Regards,
Bennet.Hi,
Declare two different variables for subtotal and total
Use them in the calculation tab of the table node.
After displaying the subtotal create a program lines node to clear the value of the subtotal. And dont forget to mention the condition in the condition tab of the text node of your subtotal as only before end of main window.
display the grand total in the text another text node with condition... only after end of main window.
regards
padma -
(Smartform) Print grand total on the last page
Hi everyone,
I'm trying to print the Grand Totals on the last page of my Smartform. I have two pages - FIRST and SECOND.
What I did was I created a Text to display the grand total, and I specified that this text should be printed 'Only After End of Main Window'. However, the total is not being printed out.
I can't change the condition to 'Not on First Page', because my form has more than two pages, and I only want the grand totals on the last page.
Any help would be appreciated.hi,
we have a window type called final window if u define this type window in second page . create a table in the window and go to calculations tab and define an internal table. i think u can get the grand totals.
if u want maore clearly go throuh this link
https://www.sdn.sap.com/irj/sdn/forums
hope this will help you.
REWARD ME IF USEFUL.
thanks,
gupta
Edited by: gupta pullipudi on Apr 9, 2008 9:23 PM -
How to get Grand Total Text in ALV GRID
Hi Folks,
I am able to get the SUBTOTAL TEXT .....But i need...
How to get Grand Total Text in ALV GRID Display...
Can any one give a Solution for this...Hi Surendar,
Check out this code.. this is showing Total Text in Toal line in the very first column.
REPORT zsales_ord_det_1 .
TABLES: ztable_10.
TYPE-POOLS: slis.
DATA: BEGIN OF it OCCURS 0,
srno(6) type c,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it.
DATA : BEGIN OF it_temp OCCURS 0,
name LIKE ztable_10-name,
age LIKE ztable_10-age,
END OF it_temp.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: v_repid LIKE sy-repid,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
gs_layout TYPE slis_layout_alv,
gd_layout TYPE slis_layout_alv,
i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
START-OF-SELECTION.
v_repid = sy-repid.
SELECT * FROM ztable_10 INTO TABLE it_temp.
LOOP AT it_temp .
it-srno = 'Total'.
it-name = it_temp-name.
it-age = it_temp-age.
APPEND it.
ENDLOOP.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'IT'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'SRNO'.
wa_fieldcat-tabname = it.
append wa_fieldcat to i_fieldcat.
LOOP AT i_fieldcat INTO wa_fieldcat.
IF wa_fieldcat-fieldname = 'AGE'.
wa_fieldcat-do_sum = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat.
ENDIF.
IF wa_fieldcat-fieldname = 'SRNO'.
Hide this field so that it can display it's content i.e.
Total text in Subtotal level
wa_fieldcat-tech = 'X'.
wa_fieldcat-no_out = 'X'.
MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
ENDIF.
ENDLOOP.
wa_sort-spos = 1.
wa_sort-fieldname = 'SRNO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort.
gd_layout-no_totalline = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = gd_layout
it_fieldcat = i_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = i_sort
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it
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.
Regards,
Seema -
Using Subquery in Select with Rollup (or some way to get grand total)
I am trying to do the following (simplified the query):
SELECT s.SYSTEM,
(SELECT COUNT(cp1.cid) FROM cfrs cp1, systems sp1, subsystems ssp1 where cp1.priority = 'P1' AND cp1.subsystem = ssp1.subsystem AND sp1.system = ssp1.system AND sp1.system = s.system) AS P1
FROM cfrs c, systems s, subsystems ss
WHERE c.subsystem = ss.subsystem
AND s.system = ss.system
GROUP BY ROLLUP(s.SYSTEM)
But the result of the Rollup on the P1 column is always 0 (it is not summing it up)
How can I accomplish a Rollup (or get a grand total) of the subquery result?
Thanks,How about this then:
SQL > WITH SYSTEMS AS
2 (
3 SELECT 'A' AS SYSTEM FROM DUAL UNION ALL
4 SELECT 'B' AS SYSTEM FROM DUAL UNION ALL
5 SELECT 'C' AS SYSTEM FROM DUAL
6 ),
7 SUBSYSTEMS AS
8 (
9 SELECT 'A' AS SYSTEM, '1' AS SUBSYSTEM FROM DUAL UNION ALL
10 SELECT 'A' AS SYSTEM, '2' AS SUBSYSTEM FROM DUAL UNION ALL
11 SELECT 'A' AS SYSTEM, '3' AS SUBSYSTEM FROM DUAL UNION ALL
12 SELECT 'B' AS SYSTEM, '4' AS SUBSYSTEM FROM DUAL UNION ALL
13 SELECT 'B' AS SYSTEM, '5' AS SUBSYSTEM FROM DUAL UNION ALL
14 SELECT 'B' AS SYSTEM, '6' AS SUBSYSTEM FROM DUAL UNION ALL
15 SELECT 'C' AS SYSTEM, '7' AS SUBSYSTEM FROM DUAL UNION ALL
16 SELECT 'C' AS SYSTEM, '8' AS SUBSYSTEM FROM DUAL UNION ALL
17 SELECT 'C' AS SYSTEM, '9' AS SUBSYSTEM FROM DUAL
18 ),
19 CFRS AS
20 (
21 SELECT 10 AS CID, '1' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
22 SELECT 11 AS CID, '1' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
23 SELECT 12 AS CID, '1' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
24 SELECT 13 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
25 SELECT 14 AS CID, '2' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
26 SELECT 15 AS CID, '2' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
27 SELECT 16 AS CID, '3' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
28 SELECT 17 AS CID, '3' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
29 SELECT 18 AS CID, '4' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
30 SELECT 19 AS CID, '5' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
31 SELECT 20 AS CID, '5' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
32 SELECT 21 AS CID, '6' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
33 SELECT 31 AS CID, '7' AS SUBSYSTEM, 'LOW' AS PRIORITY FROM DUAL UNION ALL
34 SELECT 41 AS CID, '8' AS SUBSYSTEM, 'HIGH' AS PRIORITY FROM DUAL UNION ALL
35 SELECT 51 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL UNION ALL
36 SELECT 61 AS CID, '9' AS SUBSYSTEM, 'MED' AS PRIORITY FROM DUAL
37 )
38 SELECT DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM) AS SYSTEM
39 , MAX(DECODE(PRIORITY,'LOW',CNT,0)) AS LOW
40 , MAX(DECODE(PRIORITY,'MED',CNT,0)) AS MED
41 , MAX(DECODE(PRIORITY,'HIGH',CNT,0)) AS HIGH
42 , MAX(DECODE(PRIORITY,'ALL_PRIOR',CNT,0)) AS SYSTEM_TOTAL
43 FROM
44 (
45 SELECT DECODE(GROUPING(SYSTEMS.SYSTEM),1,'ALL_SYSTEMS',SYSTEMS.SYSTEM) AS SYSTEM
46 , DECODE(GROUPING(CFRS.PRIORITY),1,'ALL_PRIOR',CFRS.PRIORITY) AS PRIORITY
47 , COUNT(*) AS CNT
48 FROM SYSTEMS
49 JOIN SUBSYSTEMS ON SYSTEMS.SYSTEM = SUBSYSTEMS.SYSTEM
50 JOIN CFRS ON SUBSYSTEMS.SUBSYSTEM = CFRS.SUBSYSTEM
51 GROUP BY CUBE(SYSTEMS.SYSTEM,CFRS.PRIORITY)
52 ORDER BY SYSTEMS.SYSTEM, CFRS.PRIORITY
53 )
54 GROUP BY DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM)
55 ORDER BY DECODE(SYSTEM,'ALL_SYSTEMS','Grand Total',SYSTEM)
56 /
SYSTEM LOW MED HIGH SYSTEM_TOTAL
A 2 2 4 8
B 1 1 2 4
C 1 2 1 4
Grand Total 4 5 7 16Oh, BTW, use "code" wrapped in "{}" on either side to post nicely formatted code. -
How to get grand total in query designer
Hi,
Antbody know how to get the grand total after the last row in query designer? I
ThanksHi,
If we select the very first Characterstic in the rows section and set the Supress result rows as "never".
That will show the overall result in the end of the report,
In the query properties tab ,check for display properties of the result.That should be set to bottom.
Hope this will work.
Thanks
Mukesh -
Grand Total on the Header page
Post Author: RogerR
CA Forum: General
Say I'm created a multiple page estimate report. As all the labor and material costs are being created and added up.
Is it possible to put that Grand Total on the first page?
Can you process the report first to get the numbers then print the report? I guess this is what would need to happen.Post Author: SKodidine
CA Forum: General
If you summarize a field (not a running total) then you should be able to create the summary field and move it to the Report Header without any problems. This cannot be done if you use running totals for obvious reasons. -
Need to Achieve Grand Total in the Data Template
Hi Team
As per the requirements i need to achieve the grand total form the various level of Total. To achieve the Total i have used the SUM function and it works fine. Could you please suggest me how can i achieve the Grand Total. For your reference i am attaching the data template here that i am using.
<group name="G_ITEM" dataType="varchar2" source="Q_ITEMQuery" groupFilter="">
<element name="ITEM_ID" dataType="varchar2" value="item_id" function=""/>
<element name="DESCRIPTION" dataType="varchar2" value="description" function=""/>
<element name="DIVISION" dataType="varchar2" value="division" function=""/>
<element name="UNITS_APPTD" dataType="varchar2" value="apptd_unit_qty" function=""/>
<element name="UNITS_RCVD" dataType="varchar2" value="unit_rcvd" function=""/>
<element name="WEIGHT_APPTD" dataType="varchar2" value="apptd_weight" function=""/>
<element name="WEIGHT_RCVD" dataType="varchar2" value="receipt_weight" function=""/>
<element name="SUM_UNITS_APPTD" value="G_ITEM.UNITS_APPTD" function="SUM()"/>
<element name="SUM_UNITS_RCVD" value="G_ITEM.UNITS_RCVD" function="SUM()"/>
<element name="SUM_WEIGHT_APPTD" value="G_ITEM.WEIGHT_APPTD" function="SUM()"/>
<element name="SUM_WEIGHT_RCVD" value="G_ITEM.WEIGHT_RCVD" function="SUM()"/>
<group name="G_TROUBLE" dataType="varchar2" source="Q_TROUBLEQuery" groupFilter="">
<element name="T_CODE" dataType="varchar2" value="trouble_code" function=""/>
</group>
</group>
<group name="G_DEPOSIT" dataType="varchar2" source="Q_DEPOSITQuery" groupFilter="">
<element name="ITEM_ID1" dataType="varchar2" value="ITEM_ID1" function=""/>
<element name="DESCRIPTION1" dataType="varchar2" value="DESCRIPTION1" function=""/>
<element name="UNIT_QTY1" dataType="varchar2" value="Unit_Qty1" function=""/>
<element name="SUM_UNIT_QTY1" value="G_DEPOSIT.UNIT_QTY1" function="SUM()"/>
</group>
<group name="G_TRANSPORT" dataType="varchar2" source="Q_TRANSPORTQuery" groupFilter="">
<element name="ITEM_ID2" dataType="varchar2" value="ITEM_ID2" function=""/>
<element name="DESCRIPTION2" dataType="varchar2" value="DESCRIPTION2" function=""/>
<element name="UNIT_QTY2" dataType="varchar2" value="Unit_Qty2" function=""/>
<element name="SUM_UNIT_QTY2" value="G_TRANSPORT.UNIT_QTY2" function="SUM()"/>
</group>
I need SUM_UNITS_APPTD, SUM_UNIT_QTY1 and SUM_UNIT_QTY2 of 3 different group to be added to generate the Grand Total. PLEASE ADVISE
Regards
SrikantHi Domnic
Thanks for the reply.
I am not much aware of the XDO. Could you please let me know can i pass the field name in place of 2 and 3 as in your example.
For example if i have field A and B and i need to add it then should it be
<?xdofx:A+B?> in RTF.
Else please give me the complete syntax.
Thanks in advance for your reply.
Regards
Srikant -
Hi,
Experts,
I am able to get the subtotal text but i am not able to get the grand total text please pass some code or idea on it.
ex:
2510 gopi 10
2511 gopi 20
subtotal 30
2521 anand 20
2522 anand 10
2523 anand 50
subtotal 80
2512 vikram 30
subtotal 30
(blank----) 140.
Here i want to get text as 'COMPANY TOTAL'. by using REUSE_ALV_GRID_DISPLAY FM.
Thanks,
Shabeer ahmed.Hi,
you can get the 'COMPANY TOTAL' by using the following code:
LOOP AT i_main INTO w_main.* Storing the Total text need to be displayed in
ALV
w_final-total = 'COMPANY TOTAL'.
w_final-field1 = w_main-field1.
w_final-field2 = w_main-field2.
w_final-field3 = w_main-field3 .
APPEND w_final TO i_final. ENDLOOP.
Regards,
Santosh -
Adding a grand total to the columns
Hi
I need to add a total to one of the columns in my report. I have set Aggregation rule as "Sum" but it is not displaying Grand Total.
Am I missing any thing or setting the rule incorrectly?
Please advise.
Thanks in Advance.
JasHi Arvindh
Thanks for your response. I am not using a pivot table I just tried to add total to the table which is created by just selecting columns required in the Define Criteria section.
We can add a total w/o creating the pivot table also. By the way, I have found the solution. The key lies in the second step. If u want me to explain in detail. Just let me know.
-Jas -
Grand Total on the same line. See Output requirment.
Env:Oracle 9I Report Writer
If I have a Table with the flwg data:
TableA
Col1 Col2 Col3 Amt
1 10
2 20
3 30
4 40How can I get the report output in the format below:
.... Amt Total
10
20
30
40 100Is this possible?Yes
presumably your total is in a repeating frame above the detail. What you need to do is make your detail repeating frame shorter than the page width. Your total repating frame should extend to the page width. You an then insert your total on the same line as the detail.
This will probably put the total at the top, rather than the bottom. I think you can get around this by using anchors -
Average of the Grand Total in the Pivot Table
all,
I have calculated a Grand Total of sum 3 days trade in the pivot table using the Totals after in the Pivot table. I wanted to obtain the average of this Grand total. How can i achecive this in OBIEE 10g.? Please help urgentI did not understand your scenario exactly. Did you try using the 'newly calculated column' option from 'More options' of the particular column for which you want the average?.
for example
segment brand 1 value
brand 2 value
brand 3 value
brand 4 value
Avg brand per segment <value>
notice that the 'Avg brand per segment' is a 'newly calculated item' where the average brand has been calculated. hope this helps. -
Hi, is possible to get a total of a column that have a date ('HH24:MI:SS') format, in a REPORT?
Because I try with the option SUM of the attributes of the region but doesn't work.
Thank!I think you have to do this manually. See my post from today talking on the leading total:
How to display TOTAL before the rows ?
Denes Kubicek -
I used with rollup to add a Grand Total in the result.
BEGIN select a.InvoiceNumber ,a.InvoiceDate,dbo.GetCompanyName(CompanyId) Company,isnull(convert(VARCHAR,a.InvoiceNumber),'GRAND TOTAL') AS InvoiceNumber, sum((Sum(isnull(Units,0)*isnull(UnitPrice,0))+ isnull(a.GST,0))) AS 'Total In Inventory',(Select ProjectCode from tblProjectmmc where id=ProjectId)as ProjectId,a.BusinessUnit,(Sum(isnull(Units,0)*isnull(UnitPrice,0))+ isnull(a.GST,0)) as InvoiceAmount, a.UserId as ProjectManager from tblinvoicemmc a inner join tblInvoiceItemDescriptionmmc b on a.InvoiceNumber=b.InvoiceNumber group by a.invoicenumber,a.GST,a.InvoiceDate,a.CompanyId,a.ProjectId,a.UserId,a.BusinessUnit with rollup ORDER BY a.Invoicenumber DESC ; End
but giving error
Cannot perform an aggregate function on an expression containing an aggregate or a subquery.
SmsBEGIN
select a.InvoiceNumber ,a.InvoiceDate,dbo.GetCompanyName(CompanyId) Company,isnull(convert(VARCHAR,a.InvoiceNumber),
'GRAND TOTAL') AS InvoiceNumber, sum((isnull(Units,0)*isnull(UnitPrice,0))+ isnull(a.GST,0)) AS 'Total In Inventory',
p.ProjectCode as ProjectId,
a.BusinessUnit,(Sum(isnull(Units,0)*isnull(UnitPrice,0))+ isnull(a.GST,0)) as InvoiceAmount,
a.UserId as ProjectManager
from tblinvoicemmc a
inner join tblInvoiceItemDescriptionmmc b
on a.InvoiceNumber=b.InvoiceNumber
left join tblProjectmmc p
on p.id = a.ProjectId
group by a.invoicenumber,a.GST,a.InvoiceDate,a.CompanyId,p.ProjectCode,a.UserId,a.BusinessUnit
with rollup
ORDER BY a.Invoicenumber DESC ;
End
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
How to get page totals at the end of the report in BI Publisher
I am using BI Publisher 10.3 and using Ms-Word template builder to design the report
and I want to implement totals for some columns (like page totals) ... can anyone let me know how to go about this
ThanksTake a look this blog: http://blogs.oracle.com/xmlpublisher/entry/anatomy_of_a_template_iii_page
You can download the template for that page.
Also take a look at the Samples folder within your BI publisher desktop folder and you can find a folder "Page Total" that has the RTF template, xml and output..
Assign points if helpful.
Thanks,
Bipuser
Edited by: BIPuser on Aug 18, 2011 8:24 AM
Maybe you are looking for
-
[votproductions@Arch ~]$ sudo uname -a Linux Arch 3.3.7-1-ck #1 SMP PREEMPT Mon May 21 21:50:24 EDT 2012 x86_64 GNU/Linux I think one of my disks are failing, /dev/sdb at ata4.0. Here's an extract from dmesg: [ 3210.426363] ata4: lost interrupt (Stat
-
Why is it that when clicking on a link in a website sometimes open a new tab in the same window (which is great) an other times it opens a completely new window (annoying)? I have already ticked the box which tells safari to open new links in tabs ra
-
I have a 52 Muvo tx that just quit playing and displayed "no music". I also have a 256 Muvo tx fm that I use as well. It has no problems so that should eliminate my computer, files, etc. as the problem. Once the 52 was plugged in and I had a look I s
-
HP C4280 Setting Default to Grayscale Printing
Hi, New to the Mac as of 2 weeks ago. I am driving myself crazy trying to find out where to change the defaults for the C4280 printer. Can someone guide me to the right place? Thanks, -Mark
-
Please tell me...