on 12-09-2008 5:22 PM
I'm using a running total field to count records for a subgroup. It does a distinct count on a field "for each record" and resets "on change of group". This works great. I'd like to take this value and multiply it by another normal (non running total) database field. So if the running total is field is "5" and the database field is "10" the result would be "50".
What is the best way to do this?
Hi, try to do this....
Place formula 1 in the section that is doing the calculation.
Place formula 2 in the group footer where you wish to see the displayed subtotal, in your example above the 30.
Place formula 3 in the group where you wish to reset the variable; group footer #1.
Let me know if that works.
Z
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Formula one is in GroupFooterSection2 (Group Footer #2) and it's displaying the correct running total because I don't have it suppressed. This looks good.
I put formula two in GroupFooterSection1 (Grouip Footer #1a) and it displays nothing.
I'm not using formula three yet until I can get formula two to display correctly.
Why won't formula two display the correct value in GroupFooterSection1 (Group Footer #1a)? This is where I want to display the subtotal.
Thank you this works perfectly.
But how do I expand this to work for a subtotal? So I want to calculate the sum per subgroup of "{#RunningTotal}*DatabaseField".
So if the result of "{#RunningTotal}*DatabaseField" is 10, 10, 10 for the first group I want to calculate the subtotal as (101010) = 30.
How do I do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
You can try to use 3 formulas.
Formula 1 called StoreValue & place in group footer:
WhilePrintingRecords;
Global Numbervar RunningVar;
RunningVar := RunningVar+("{#RunningTotal}*DatabaseField);
RunningVar;
Formula 2 called GetValue & place in group footer:
WhilePrintingRecords;
Global NumberVar RunningVar;
RunningVar;
Formula 3 called ResetValue & place in group header:
WhilePrintingRecords;
Global NumberVar RunningVar := 0;
That should do the trick.
Having some trouble deciphering where to put the formulas. This report has three sections with their own headers and footers.
So formula one keeps a running total and stores the value in variable RunningVar. I get that. But what does formula two do? Does it just display the value in variable RunningVar?
Ultimately I would like to display this sum in GroupFooterSection1 (Group Footer #1a).
No matter where I put these formulas I can't seem to get them right.
What am I missing?
Greg,
Create a formula and disply it in you group :
{#RunningToal}*DatbaseField
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.