Running Total in Group Header
Post Author: bahamaER
CA Forum: Crystal Reports
Hello, I have been reviewing threads for running totals and would like some assistance on creating a running total for a group with a condition that will display in the group header, the running total should also reset for each group. Is this possible?
I know that there are some constraints such as the variable being reset to 0 in the header for each group as well as the group records have not been rendered when the header formulas are being assessed. I have been able to accomplish the task of running totals with conditions for groups using a running total field and also 3 separate formulas placed in the group header, detail and footer. The display is only correct in the group footer; my goal is to have the footer formula in the group header. Any ideas? I am currently using CR 8.5 but will be upgrading to CR 2008.
Thankyou
Hi,
If you are trying to calculate Total and display it in Group Header for field value placed in Detail, then you will get incorrect/no value for total, as Crystal Reports prints/processes the report line by line and it will not be able to process the Total for field in Detail section in Group Header.
Its is by Design.
For a workaround:
- Insert the same probematic report (Say A.rpt) as a Subreport in Group Header of this report(Say A.rpt).(Say in GroupHeader A1) and link the Main Report to the
- Insert Section Below (Say GroupHeader A2)
- Calculate Total in Section Group Header A2)
This workaround will reduce the Performance of the report as Subreport will be proceed for each Group Value.
Regards,
Kiran
Similar Messages
-
Running total in group header doesn't display when it's at page bottom
Post Author: Charles Denight
CA Forum: Formula
Hi, Using v.9 of Crystal Reports I've created some running totals using a cross-tab workaround to get the running totals into the group headers, but when the group header falls at the bottom of the page then the running total doesn't show up.Would appreciate knowing why and how to fix this.Replacing an item that is malfunctioning because of a manufacturing error is the bare minimum I would expect from customer service for any electronics item.
The thing Apple does extremely well is their flat fee policy for repairs on their computers.
I managed to break my MacBook pretty seriously (logic board needed to be replaced) and I'm sure it cost them more to repair the unit than the $328 they charged me.
I probably would have been angry if it was something minor, but I'm guessing that most repairs to screens/motherboards/etc cost more than their flat fees. -
DISPLAY RUNNING TOTAL IN GROUP HEADER
Post Author: sharonmtowler
CA Forum: Formula
I know there is a way to do this, just forgot how. i am in version 8.5. i have a manual running total which calculates order qty for the entire sales order.i (dont like using the rt wizard-buggy)
the knowledge base says to use a cross tab, but there hit or miss also.
does anyone know how to show the display formula for a manual runnning total in the group header instead of group footer?Post Author: pandabear
CA Forum: Formula
Hi Sharon,
I wanted to try this before I sent it to you, but my Crystal is down because (blah, blah, long story here....yawn....).
I think I understand. You want to show the "Total" for each group, in the group header instead of the group footer?
My experience is that Crystal works from the top down (read: limiting), so I need a work around to do this.
1 - Do the calculation in the query...sum by group, filter with a "Case" statement, etc. If there's a reason you can't do that then
2 - (and this is what I wanted to try first) see if you can group on the same field twice.
Group 1 - Test.field
Group 2 - Test.field (same field)
If you can,
then just carry the total from the group footer of the previous group (same field) above you, and bring it down
(shared var ?) to the group below.
My 2 cents is up.
Hope this helps,
The Panda -
Hey,
I may be having a brain freeze. I need to print a running total (max) above the detail lines of a report. Since the running total is not known until after the detail lines, is there a way to do this? I'm stuck and frustrated. Thanks,
JimI'm starting to think I am going about this in the wrong way. My report has a field named 'tolerance' which is on every other record but does not appear in the report detail. It is the same value for every record in the group. I need to capture the value and display it in the group header. I was attempting to do a max() running total, and the field looked fine in the group footer, but when I copied it to the group header to changed to blank.
I think there must be a simpler way to do this, but I don't know what it is. Thanks for your help,
Jim -
How to store running sum of group header fields
HI All,
I am bit confused how to do this so writing the post here. I have a group header which gets the amount spent by cost centre by account number
the group contains the following fields
[Account Number] [SDESCR] [sum of coscentre1] [sum of costcentre2] and so on.
The end result i get as follows
Account number Description Coscentrenumber1 CostCentrenumber2 and so on
100 cash at bank 6000 7000
200
and so on
now i want
Total Sumof(Costcentrenumber1) Sumof(Concentrenumber2)
how can I achieve this ? am confused how to store the value of [sum of costcentre1] into a shared variable and use this shared variable in page footer to display the total ?Let me be more clear I need the out out something like
Account number Description Costcentrenumber1 Costcentrenumber2 Costcentrenumber3
100 6000 7000 800
200 4000 5000 300
Toal 10000 12000 1100
the account numbers are placed in Group header so that we group all the transactions by account number. Say for example when i said account number 100 above in the backend
it is as follows
Account number Costcentrenumber1
100 2000
100 2000
100 2000
In the crystal the above logic is placed in Group header by creating Group Name fields
so that end result in the report it is shown as
Account number Coscentrenumber1
100 6000
Now in the report at the end i want the sum by Costcentrenumber.
as 10000 shown above.
Hope am clear. -
Post Author: cjsmile2106
CA Forum: Formula
Hello Everyone
I have a weird problem. I have a report that has three groups. In each group I have manual running totals. I would like to take a manual running total that I have in Group 2 and subtract it from my Group 3 manual running total. However when I attempt this for some odd reason by manual running total from Group 2 is not subracting that same number. For example:
Group3
5 - 7 = -210 - 7 = 315 - 7 = 820 -7 13
Group 2
-7
Its not doing that however, it seems to be subracting some random numbers instead of the Group 2 total. Thank you for your assistance!Post Author: sharonmtowler
CA Forum: Formula
make sure you do not have repeat group header or keep group together checked, causing weird mrt. make sure the variable name is not used in another variable name. you may need to place the formula that is subtracting the display formulas below the other to get an accurate set, and use whileprintingrecords -
Post Author: llcoolt
CA Forum: Formula
I have a couple of group running totals:
TotalItems
TotalCompleteAtExp
I need to create a formula that finds the percentage of the two. Any help? Would this be in a running total?Post Author: llcoolt
CA Forum: Formula
but it's calculated at a group level, not as a percentage for the whole report.
The running totals were grouped by vendors. The percentage I was looking for was also grouped by vendor, not a percentage of ALL service orders and the vendors they were assigned to, but percentages run per vendor based on those completed by vendor. -
Running Total does not reset when group changes
I have a manual running total for group3 that does not reset for group2
Group2 Header (Order Status 3=Open,4=Closed)
WhilePrintingRecords;
currencyVar WIP=0;
Group3 footer (Order Number)
WhilePrintingRecords;
currencyVar WIP;
WIP := WIP + {@NETWIP}
Group2 footer
WhilePrintingRecords;
currencyVar WIP;
There are no Repeat Group header on any of the groups
Will add Group1 total when this part works.I am not sure if you made a typo when making your post but you are missing a colon when resetting your variable
change from this
currencyVar WIP=0;
to this
currencyVar WIP:=0; -
Running Total Grouping Formula
I have a running total condition that I need to summarize the field CAWP.BAC. I would typicaly evaluate this total for change of group 4 and reset on change of group 3. I need to condition the evaluation for ".900" in {CAWP.WP} but i also need to evaluate for change of group 4. Does any one have any examples of a formula for evaluation "on change of group"?
Hi John,
For this you can try using manual running total formula's.
1) Create a @reset formula as below and place it in group header 3.
Formula :
Whileprintingrecords;
Numbervar i:=0;
2) Create an @evaluation formula and place it in detail section.
Formula:
whileprintingrecords;
numbervar i;
if {CAWP.WP} = ".900" then
i:= i+ {CAWP.BAC}
3) Create a @display formula and place it in group footer 4.
Formula:
whileprintingrecords;
numbervar i;
Hope this will help!!
Regards,
Vinay -
Running total across 2 grouping
Hi All
I have created a crystal report and i have 2 remaining issues that i just cant get around.
the report is basically about all the net stock position.
the report is based on a query..that links sales order to all target documents that originate from the sales orders, i.e...deliveries, invoices, returns, credit notes.
then i also brought in all the open purchase orders and the instock from the oitw
i then sumed up the lines so the sales order > Delivery > invoice > credit note > returns all shows in one line..and if there is a different unit of measure it will be another line for that sales order
the report is grouped:
per warehouse
per item
per Sales Order Num
per Item Unit of Measure
per Line Num
1st issue:
in the selection criteria if the sales order is closed but if one of the delivery notes is open it should bring in the "whole set" not just the the open deliverys linked to the sales order.
this is because the delivered quantities adds up to the net position of the stock.
2nd issue:
I have to work out a net postion
formula: net stock = Oitw.instock + PO - remaining qty on sales order
I got the sales order as a negative
i used a running total formula, but it does not work if the sales order has more then one unit of measure.
whileprintingrecords;
If onfirstrecord or previous({Command.SO No.})<>{Command.SO No.} then
numbervar remain_bal:= remain_bal + {@QTY}
i tried to add another if statement..but does not work
whileprintingrecords;
If onfirstrecord or previous({Command.SO No.})<>{Command.SO No.} then
If onfirstrecord or previous({Command.SO Uom)<>{Command.SO Uom.} then
numbervar remain_bal:= remain_bal + {@QTY}
any help will be gladly welcomed..
thank you all
JerushaHi Dave
Thank you very much for your feedback.
I have been using the base UoM, ie InvQty field.
my issues comes where i am grouping I am 1st grouping by sales order num, then by uom as the customer wants to see that as separate entries
Example:
SO Num Uom Qty InvQty
1 Bags 50 200
1 Bulk 100 100
This is the forumula for the running total:
If onfirstrecord or previous ({Command.SO No.}) <> ({Command.SO No.}) then
if ({Command.Doc Type}) = 'SO' then
SO := SO + {@QTY}
However when i "print" my total and add it to the footer.. it will show 200 instead of 300.
Thanks
Jerusha -
Oracle report running total Resetting balance on next group
Dear All,
I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
In brief
Asset 1
cost Deprciation Adjusted Cost
50 - 2 48
48 -5 45
45 - 4 41
I achieved that by using
if :p_val is null then
:result := nvl(:cost,0)-nvl(:depriciation,0);
:P_val :='5';
return :result;
else
:result := nvl(:result,0)-nvl(:depriciation,0) ;
return :result;
end if;
working fine
But problem is when the next asset start on same report
Asset 2
cost Deprciation Adjusted Cost
100 5 36
it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
Oracle Champs pl advice me how to solve this.
I really dont got any idea how to solve this.
thanksDear,
Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
thanks -
Running total / Summary - 3 groups
Dear All,
I am facing an problem in Summary / Running Total in my crystal Report. I have 3 groups as under :
1) Document Series
2) Territory
3) Transaction Details which includes Document Total
Now Example my document series is Projects and Territory is Japan and India and in Transaction Details which is document total has values of 100, 200, 300,500 for Japan and 300,400 for India
Now I am not able to bring a summary / running total of Japan which should be 1100 and for India 700 respectively.
I want summary for Document Series Also means for Projects it should show the total of 1100 + 700 = 1800
and a grand total of 1800 if its only projects series and if other series it should show projects + handling series.
Pleas help as I have tried but not been successful.
regards,
kamleshfor Territory Running total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: on change of field -> Territory
Place it in Territory Group footer
for Document Series Total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: documentseries
Place it in Document Series group Footer
for Grand Total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: never
Place it in Report Footer
HTH,
Jyothi -
Sort Group Based on Running Total
Is there a way to sort the group based on the running total of the group?
Thanks!
DeannaI think it is not possible to sort the group based on a running total. You can sort based on a summary field using group sort expert. Since the running total executes whileprintingrecords we cannot sort based on running totals.
Regards,
Raghavendra -
SSRS 2008 Running Totals - How are they created at the grouping by level
I am trying to create the running total column(the right column) month-to-date, and I am new to SSRS. Is this possible to do on the SSRS-side, or, will I need to do this in the SQL stored procedure that SSRS is calling?
Number Enrolled
Number Enrolled
Enroll Date
Enroll Type
Enroll Group
Enroll Offer
Enroll Source
DAILY
MTD (Running Total)
10/1/2013
Online
Internet
1234
ABC
1
1
10/2/2013
Online
Internet
1234
ABC
0
1
10/3/2013
Online
Internet
1234
ABC
6
7
10/1/2013
Online
Internet
1234
DEF
4
4
10/2/2013
Online
Internet
1234
DEF
6
10
10/3/2013
Online
Internet
1234
DEF
0
10Hi Mitch1743,
According to your description, you want to get the total number on each row. Right?
In Reporting Service, we can use RunningValue function to do aggregation calculating for each row. Put expression: =RunningValue(Fields!Sales.Value,sum,”Group2”) into the last column (Group2 between “” is the parent group of detail rows).
We have tested it in our local environment , the table and result will be looks like below:
Reference:
RunningValue Function (Report Builder and SSRS)
Understanding Groups (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Running total as header formula
I am looking for a simpler, more general, or just plain better way to calculate a running total of a column of numbers, such that the running total cell is the sum of a number in the same row & a different column plus the cell just above it in the same column.
IOW, if the numbers column is H & the running total column is J, I could use =H5 + J4 in cell J5. In J6, I could use =H6 + J5, & so on. I can extend the formula downward without any problems, but I must make an exception for the first row of data: for instance, if row 2 is the first to have a number to include in the running total, then in J2 I must use =H2, since J1 is a header column.
This means I can't use a simple formula in a header column for the running total. (I want to do this because I will be adding rows as the table is used, & I want all the formulas to automatically be added to each new row.)
After trying a lot of functions, I finally came up with this one for the header formula:
=H + INDIRECT(ADDRESS(ROW()-1,COLUMN(),4))
It works, but I suspect there is an easier, more elegant, or more general formula that (for instance) won't break if I rearrange the columns in the spreadsheet.
Any comments would be appreciated.Yvan,
Thank you for your comments, & for the formulas. I was hoping there was a simpler way to do this than with INDIRECT & ADDRESS, but apparently not.
In this particular spreadsheet, I do not need to worry about any blank values in column H because they are the results of a calculation that yields a number even if the row is otherwise blank.
The ISERROR clause does allow me to name the running total column since without it the formula would be trying to add a string to a number in row two. However, in this particular spreadsheet I do not need to name that column because it is hidden. (The running total number column is used in another column that formats it as part of a string that contains other conditional information.) In the interests of simplicity, I will not add the ISERROR clause to my formula in this spreadsheet but I will keep it in mind for use in other spreadsheets in which the column will not be hidden & needs to be named.
Of course, as an alternative I could just create the column name as an independent text object. Wherever possible, I tend to favor workarounds like that to reduce formula complexity.
Maybe you are looking for
-
Creative Zen 8GB Random Shuffle
Creative Zen 8GB Random Shufflej I have owned a Creative Zen V Plus 4GB for two years and have really enjoyed it. About a month ago, the screen started to fade out and is now totally black. I have researched this problem and have come to the realizat
-
Passing 2 date parameters in report
I have to create a report in such a way that ...i have to pass 2 date parameters to get the report.. For example.. I get report parameter pagein reports and then I enter the parameter Parameter1: 27-MAY-10 Parameter2: 30_JUN-10 and then i click RUN R
-
Aperture2 - Recovery and Black Point adjustments question
I purchased the Aperture2 upgrade and, I'm impressed!!! I have a question: In the *Adjustment Tab*: Two features in the *Exposure area, "Recover and Black Point"*, works sometimes and other times it does not. There must be a reason for it - I just ca
-
Upgrade question from 10g to 11gr1
Hi All Planning to upgrade 10.2.0.4.0 to 11.1.0.7.0 After executing utlu111i.sql SQL> @utlu111i.sql Oracle Database 11.1 Pre-Upgrade Information Tool 07-19-2011 10:56:38 Database: --> name: TEST --> version: 10.2.0.4.0 --> compatibl
-
Deleted photos not deleted from hard drive
I have deleted photos from Lightroom 4 by choosing the 'remove from disk' option. I never want to see them again so want them to go into the iMac Trash. However they are still in the folder where the original RAW files are on my desktop. Am I doing s