Calculating totals in report
I have an invoice report that has billing categories and under each billing category there are one or more bliing category lines. I want to calculate the total for each billing category e.g.
BILLING CATEGORY 1
Billing Category 1 0.00
Billing Category 2 1.00
Category Total 1.00
BILLING CATEGORY 2
Billing Category 1 0.00
Billing Category 2 1.00
Category Total 1.00
Client Total 2.00
Can anyone please help me by giving me a step-by-step guide? I have created the query to retrieve data from the database and saved the data in an XML document. I have created the RTF template and so far it is not showing the Category Total and Client Total.
Hi,
It's quite difficult to give you an exact step-by-step guide without your XML, but I'll give it a go. Given the following XML:
<billing_categories>
<billing_category>
<category>BILLING CATEGORY 1</category>
<sub_category>Billing Category 1</sub_category>
<amount>0.00</amount>
</billing_category>
<billing_category>
<category>BILLING CATEGORY 1</category>
<sub_category>Billing Category 1</sub_category>
<amount>1.00</amount>
</billing_category>
<billing_category>
<category>BILLING CATEGORY 2</category>
<sub_category>Billing Category 1</sub_category>
<amount>0.00</amount>
</billing_category>
<billing_category>
<category>BILLING CATEGORY 2</category>
<sub_category>Billing Category 1</sub_category>
<amount>1.00</amount>
</billing_category>
</billing_categories>In your RTF Template you would need the folliowing:
<?for-each-group:billing_category;./category?> <?category?>
<?for-each:current-group()?> <?sub_category?> <?amount?> <?end for-each?>
Category Total: <?sum(current-group()/amount)?> <?end for-each-group?>
Client Total: <?sum(amount)?>Each <?command?> should be placed in a seperate Text Form Field within your RTF.
Hope this helps
Andy
Similar Messages
-
Crystal reports- Calculation between two reports
Hi Experts
I have designed a sales and purchase transaction report using crystal reports and i have designed another report for accounting transactions like Excise Duty payable and receivables, Vat payable and receivables, Expenses(like EB, Maintenance) and so on. Finally I added accounting report as sub-report into First Report.
My question is, is it possible to made some calculations between sub-report and main report.
Hope some solutions from you.
By
KalaHello,
right upto the linking is good?
Right now you have to create a formula (which you might have already done for "Total expenses", you just need to alternate it slightly.
Example:
On 2nd report (subreport) You might have a formula like given below.
Instead of Numbervar CAvg, which is the last shown value in the below formula, you have to make it like Shared Numbervar CAvg.
Whileprintingrecords;
Numbervar TJs;
Numbervar TotalJobs=0;
Shared Numbervar CAvg;
Shared Numbervar CAvg=0;
TotalJobs := DistinctCount({lab_credits.credit_no},{lab_credits.reason_code});
CAvg:= TotalJobs /{@WorkingDays};
TJs:=TJs + CAvg;
CAvg
Do your calculation above.
Now in the main report you will create another formula which will look like below.
Whileprintingrecords;
Shared Numbervar CAvg;
Numbervar TAvg:=fieldname;
Numbervar TotalBoth:= Shared Numbervar CAvg+ Numbervar TAvg;
TotalBoth;
You will have a reset formula which will be placed ontop of the report header , group header if you are using grouping like this
Whileprintingrecords;
Shared Numbervar CAvg:=0;
SHared Numbervar TAvg:=0;
bearing in mind that we do not have to declare CAvg field here as it is being shared.
Hope this helps
Regards
Jehanzeb -
Calculating Total Ending Inventory
Hello BW Gurus,
I have a reporting question for you. Please reply back as soon as possible as I am nearing the deadline.
The scenario is as below:
I need to calculate the Total Ending Inventory and the formula is as below:
Total Ending Inventory = A B C + D + Last Period Total Ending Inventory
How would I calculate the Last Period Total Ending Inventory? Total Ending Inventory is just a Calculation and is stored no where in BW. Since I am running the report for the first time this month, Last period 'Total Ending Inventory' would be Zero for the current month. But current month's Total Ending Inventory would become next month's Last Period Total Ending Inventory. To acheive this, I need to store the Calculated Total Ending Inventory somewhere in BW so that I can pull this information when I am calculating next month's Total Ending Inventory.
Please let me know the solution and the steps involved as soon as possible.
Thank you very much in advance.
Best Regards,
Rajiv.Hi Anil,
Thanks for your reply. The problem here is Total Ending Inventory is not a KF that is stored in a Cube. It is a calculated Key Figure. When I am calculating Total Ending Inventory I need to add last period's Total Ending Inventory to the calculation. Any idea on how to achieve this?
Thanks in advance.
Best REgards,
Rajiv. -
Create calculation in webi report
Hi
I need calculate in a report like below.
For example report as below.
Region revenue
North 200
South 390
Total
east 100
west 50
Total
Grand Total
Reg above i have two questions
1)How can i do the calculation for this report?
2)I need to add any free hand cells for TOTAL rows in report?
Please advide.
Best Regards,
AbhiiHi Abhi,
Simple Way : Break the table by Region and apply Sum Aggregation on qty. you will have a display like this
Region revenue
North 200
Sum 200
South 390
Sum 390
east 100
Sum 100
west 50
Sum 50
Sum 740 ( Grand Total)
Other Way: Create a new report variable ,apply break on Region_num & use Sum Aggregation on Qty.
Output will be like this
Region_num Region Revenue
Region 1 North 200
..............South 390
Sum............... 590
Region 2 East 100
..............West 50
Sum...............150
Sum................740 (Grand Total)
Regards
Sunil
Edited by: sunilkumar.k on Mar 5, 2012 4:21 AM -
Shared DateVar in Subreport and datediff calculation in Main Report?
Hello experts,
I am using CRXI sp2. I have a report that contains two subreports for different dates in the same date field that are identified by a Service Code. The subreports have been placed in the same group footer 1a to be displayed and the calculation resides in the main report group footer 1b. The shared variables are as follows:
whileprintingrecords;
shared datevar Codedate5473;
Codedate5473:={@Codedate5473};
and
whileprintingrecords;
shared Datevar Codedate5623;
Codedate5623:={@Codedate5623}
The main report has the following calculation is in group footer 1a.
Whileprintingrecords;
Shared numbervar daysbetween;
if (isnull({@Shared 5623})or isnull({@Shared 5473})) then 0
else daysbetween:= datediff("d",{@Shared 5623},{@Shared 5473})
This returns negative numbers as well as calculations where one of the shared variables is null.
I reset the calculation in the report header as well.
Thanks for your help in advance.
KevinHi Kevin,
I can reproduce your issue, As per my knowledge the crystal will make some issues in null value computation as well as shared variable computation
In your report i can see , you tried to access values from subreport to main report through shared variable. that will make problem. we can access values from main report to subreport without any issue using shared..dont ask me the reason..i am not the right person to say that... lol.
The another wrong thing i was found in your formula is , you are not resetting the shared variable any where.. so once the date field is null, the shared variable returning the previous value.
So this is the solution for you..
1,You have to add one more subreport for displaying your result., Lets say 'Sub report3'
and create a formula, like.(Same which you have write before for the result)
shared datevar Codedate5473;
shared Datevar Codedate5623;
numbervar daysbetween;
WhilePrintingRecords;
daysbetween:= datediff("d",Codedate5473,Codedate5623);
daysbetween;
2, Re- write your first two formulas like this
For Subreport1,
WhilePrintingRecords;
shared dateVar Codedate5473;
if isnull({Codedate5473}) then
Codedate5473:=date(0,0,0)
else
Codedate5473:=date({Codedate5473});
For subreport2
WhilePrintingRecords;
shared dateVar Codedate5623;
if isnull({Codedate5623}) then
Codedate5623:=date(0,0,0)
else
Codedate5623:=date({Codedate5623});
Hope this will works for you,
Cheers,
Salah.
Edited by: salahudheen muhammed on Aug 7, 2009 1:05 PM -
Profit center accounting totals records report 2KEE:
Hi,
When I am executing Profit center accounting totals records report 2KEE for a specific selection as below,
Record type: 0
Version: 0
Controlling area:
Company code:
Posting period :1
Fiscal year:2007
Profit center: 1000dummy
Account:
After report is generated and if drill down further, line items total is not matching with the report page, breakup gives different values but not the report value.
I tried report even after implementing OSS 892779 and 952263 but the result is same. I am using 4.7
Request your help in this.
Regards,
Lakshmana RaoDear Eugene,
What do you mean? What is the report? -
I am using a PC with window 7 and adobe photoshop 12. I have followed Photoshop Elements Help and I still have the same problem. When I try to backup Photoshop 12 it has stop on7% when calculating Total Media size. What can I do?
Hi Prabhuram and falez,
This issue appears where there are any inconsistencies in your catalog (generally for video files). This issue may be due to offline files, missing files, video scenes. The recommendation here would be to fix these inconsistencies and try again. If that doesn't solve the issue, please follow steps mentioned in email by me.
~Surendra -
Calculating total memory in oracle RAC environment
I have to calculate total memry in RAC environment.
For shared and buffer pool I execute show sga.
For UGA and PGA I execute statement that have two different values.
This is my two different methot for calculating total memory in oracle RAC environment.
Why I have very different value in this 2 statements on pga values?
first stat
with vs as
select 'PGA: ' pid
,iid
,session_pga_memory + session_uga_memory bytes
from (select inst_id iid
,(select ss.value
from gv$sesstat ss
where ss.sid = s.sid
and ss.inst_id = s.inst_id
and ss.statistic# = 20) session_pga_memory
,(select ss.value
from gv$sesstat ss
where ss.sid = s.sid
and ss.inst_id = s.inst_id
and ss.statistic# = 15) session_uga_memory
from gv$session s)
union all
select 'SGA: ' || name pid
,s.inst_id iid
,value bytes
from gv$sga s
select distinct iid, pid, sum(bytes) over (partition by iid, pid) bytes from vs
IID PID BYTES
1 PGA: 196764792 <=====
1 SGA: Database Buffers 318767104
1 SGA: Fixed Size 733688
1 SGA: Redo Buffers 811008
1 SGA: Variable Size 335544320
2 PGA: 77159560 <=====
2 SGA: Database Buffers 318767104
2 SGA: Fixed Size 733688
2 SGA: Redo Buffers 811008
2 SGA: Variable Size 335544320
second stat
with vs as
select 'PGA: ' pid
,p.inst_id iid
,p.pga_alloc_mem bytes
from gv$session s
,gv$sesstat pcur
,gv$process p
where pcur.statistic# in ( 20 -- = session pga memory
,15 -- = session uga memory
and s.paddr = p.addr
and pcur.sid = s.sid
and pcur.INST_ID = s.INST_ID
and pcur.INST_ID = p.INST_ID
union all
select 'SGA: ' || name pid
,s.inst_id iid
,value bytes
from gv$sga s
select distinct iid, pid, sum(bytes) over (partition by iid, pid) bytes from vs
IID PID BYTES
1 PGA: 342558636 <=====
1 SGA: Database Buffers 318767104
1 SGA: Fixed Size 733688
1 SGA: Redo Buffers 811008
1 SGA: Variable Size 335544320
2 PGA: 186091416 <=====
2 SGA: Database Buffers 318767104
2 SGA: Fixed Size 733688
2 SGA: Redo Buffers 811008
2 SGA: Variable Size 335544320I'm sorry but it is not clear to me.
- From v$session (1th stmt) I have
nearly 196MB of PGA mem on instance 1
and
nearly 77MB of PGA mem on instance 2
- From v$process (2th stmt) I have
nearly 342MB of PGA mem on instance 1
and
nearly 186MB of PGA mem on instance 2
then...
342+186 - 196+77 = nearly 255MB of memory allocated by oracle processes but free?
if I want calculate the total thing of the amount of the allocated memory from Oracle...It is more correct 2th statement that query v$process...it is true? -
Hi,
Can any one tell me how to create a running total in Oracle reports. I have two fields pulled in the SQL called CR and DR. I want to do the running total at report level. Here what I want
CR------DR-------RTOTAL
20-----10---------10 ( here the RTOTAL Field is (20 - 10) )
30-----15---------25 ( here the RTOTAL Field is (30 - 15) + 10)
50-----25---------50 ( here the RTOTAL Field is (50 - 25) + 25)
75-----35---------90 ( here the RTOTAL Field is (75 - 35) + 50)
Thanks
-FerozHello,
You can use the following SQL query :
select cr,dr,cr-dr cr_minus_dr from <table> ...
and create a Summary Column in the Reports :
Source : the field cr_minus_dr
Function : Sum
Regards -
Title says it all. I would like to know how to do total in report.
Thank you.Welcome to Oracle Forums!
Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
Also, get yourself a friendlier handle, 974072 is not friendly
Always state
<ul>
<li>Apex Version</li>
<li>DB Version and edition</li>
<li>Web server used.I.e. EPG, OHS, ApexListner Standalone or with J2EE container</li>
<li>When asking about forms always state tabular form if it is a tabular form</li>
<li>When asking about reports always state Classic / IR</li>
<li>Always post code snippets enclosed in a pair of {code} tags as explained in FAQ</li>
</ul> -
Calculating Totals for a column in ALV Grid Display
Hi All,
I frustrated with the problem of simple calculating total for a column. I wrote the following code:
LW_CATALOG-TABNAME = P_GV_STRUCT.
LW_CATALOG-FIELDNAME = 'ZSUMMS'.
LW_CATALOG-DO_SUM = GC_X.
APPEND LW_CATALOG TO G_FIELDCAT_TAB.
CLEAR LW_CATALOG.
It is not working. Could you please suggest the solution?
It would be great help to me.
Advanced Thanks,
Phani KumarPhani,
Did u try playing around with any of these layout fields ?
no_sumchoice(1), " no choice for summing up
no_totalline(1), " no total line
no_subchoice(1), " no choice for subtotals
no_subtotals(1), " no subtotals possible
no_unit_splitting " no sep. tot.lines by inh.units
totals_before_items, " diplay totals before the items
totals_only(1), " show only totals
totals_text(60) , " text for 1st col. in total line
subtotals_text(60) , " text for 1st col. in subtotals
b. Addtionally... not a solution.. but u know...
just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ? -
How to give the calculation in Finacial report templates asper indian local
Dear experts
help me, how to give calculation in Financail report Templates in SAP b1 for calculating Gross profit and Netprofit seperately. I am facing some error while giving formula in financial report templates.
Thanks
RegardsHi Mathiladath,
Try this,
->> Financials. -> Financial Report Templates in that follow this steps.
1.Report. -> Choose (Profit and Loss)
2.Template.-> Define New -> Give the name for template.
3.And click the Generate Chart of account button in bottom right.
4.put the Tick mark in Subtotal Check box
5.now u can see Formula button (Click and Open the Formula Definition window and put the Formula)
using this button create appropriate formula for your requirement(ask help your A/C department)
6.Chose this template in P/L.
Regards,
Madhan. -
Mathematics calculation in Webi Report using "For Each"
Hi All,
I am using BOXI R3.0, I am stuck in webi calculation for one report report tab. I have 2 tab in one report, one is summary and other is Detail in same report. In Detail tab the data looks like as below:
DataSet 1:
DNo.-Date-Hours-Vol-Pri---Tot(Vol*Pri)
10 -1/12- 01:00---10 ---10 ---100
10 -1/12- 02:00---20 ---50 ---1000
10 -1/12- 03:00---30 ---30 ---900
Sum: 2000
Now the above is my detail reprot which gave me data by hour, now in summary i removed the hour column then data looks like below:
Dataset 2:
DNo.-Date-Vol----Tot(Vol*Pri)
10 -1/12- 60 -
1800
This is because "Vol" measure is sum in universe and Pri is Average.
This gave me wrong data so How i calculate Tot for Sumarry tab such that it will give me below result.
Dataset:
DNo.-Date-Vol---Tot(Vol*Pri)
10 -1/12- 60 ---2000
Thanks for the help in advance.
Thanks,
Nimesh.Hi Nimesh,
I think you need to wrap a sum around the function and use an input context.
=(Sum([Pri] In ([DNo]; [Date]; [Year])))*[Vol]
This will sum the average values down at the year level and multiply it by vol, even though year is not on the table.
Let me know how you get on
Regards
Alan -
Organizer 12 backup stops while calculating Total Media Size
I have not successfully completed a backup with PS Organizer 12. It stalls at 16 or 17 % calculating Total Media Size. My Photo folders are about 180 GB. I have 287GB free on my data drive. My Apps drive is a 100GB SSD with 36GB free. When Backing up I am given the choice for full backup of the partial. I chose full. It does not ask for a folder. Do not know why. I transferred my photo folders from my previous PC, then transferred my USER PSE files and all worked fine, all attributes were transferred. In addition I have optimized my catalog; cleaned the thumbnail CACHE by changing the .dat files to .old and restarting; set my Registry for maximum file size in Organizer to 1.5GB, my largest file size is 1.2GB;
deleted files from the Catalog larger than 50MB and all files and imported them back in. The Adobe help has help topics of either Back up your catalog to an external hard drive or Back up your catalog to a CD or DVD (Windows Only). They do not mention a thing about backing up onto your PC, they do not say you cannot. Well, oh, I have 8GB RAM and an Intel Core i7. Suggestions appreciated.I identified the problem as to why PSE 12 Organizer was freezing during backup procedures. The problem of freezing during backup calculation of the file size is caused by the existence of *.MOV file types. Both my Nikon camera and my Kodak digital cameras save video recordings in *.MOV file formats. This is likely a rare case, as only users who have Kodak or Nikon Cameras would be affected.
I had to select, filter, all files with *.MOV formats and delete them from my catalog. After the catalog was backed up successfully on my hard drive, same drive, different folder, I had to drag and drop the videos to get them back into the catalog. All tags and locations and people were lost. I could not search them and import from folder. So the catalog is backed up successfully. This is likely a rare case, as only users who have Kodak or Nikon Cameras would be affected.
Case Solved.
Elements 12 backup failPhotoshop ElementsProblem with backing up catalog in Elements Organizer 12 - help please@ -
When I try to backup my catlaog the program locks up during the "Calculating Total Media Size" process at 33%?
I have seen this before and it is probably a bad video. There is no great solution. To determine if this is the cause I would remove all your videos from PSE and try to do a backup, if the backup works, one of the videos is bad. It is trial and error to determine which video. When you remove your videos from PSE make a note as to where you have put them so you can reload them..
Maybe you are looking for
-
Broadband drops 'out' more than 'in' - OpenReach a...
First, forgive me if a similar problem has been posted; I've had to resort to a 2G O2 dongle & speeds are so bad that I can't search the forum. For weeks (months?) now I've had terrible broadband connectivity - sometimes going for days without a con
-
What is the wrong about converting the .class of api of jc to .cap files?
hi everyone l tried to convert the .class filses of api to .cap files,there are some wrongs please help me! ___the .opt file:___ -out JCA CAP EXP -exportpath D:\jCDK2_2_1\api_export_files -classdir D:\workspace\framework framework 0x0a:0x0:0x0:0x0:0x
-
How to load a SQL Server Image datatype into Oracle
I am trying to use the follwing procedure to transfer image datatypes from SQL Server into Oracle: DECLARE v_update_string VARCHAR2 (200) := 'select face from multiMax.dbo.CardHolderFaceTable where cardid = 246979'; v_result VA
-
i ws workin on my laptop standalone server.. and system shutdown .. and rebooted when i strated the server again it gives eror "snap-in creation failed"... the snap-in is not created,it may not be installed properly . name: sap r/3 manager CLSID:{633
-
My "profile" account works flawlessly with the exception of safari. I had copied the entire user template folder to the default location in OS X 10.10 and removed the entire keychain folder. However, whenever someone logs into the computer for the fi