Topic: Scope of Running Totals Posted: 03 Feb 2012 at 11:53am
I want to use a running total found in the details section in the Group Header 2 levels above. The RT counts the number of events in the details section and I want that total displayed in group header #2. The problem is, I only get the first value when I want the last value. The RT counts, evaluates each record and resets on change of the field.
The problem with Count(field, group field) is that I am suppressing some details based on user input (via parameter field), so the Count() function is adding the suppressed fields into the count. I need to use RT but get the total prior to going to the next group.
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 06 Feb 2012 at 3:48am
you can maybe use formual fields that use your params to creaet a value in the formula field that would be counted or summed.
if not(param suppression criteria met) then field
This is from the Details suppress formula:
Global NumberVar suppressedCount := 0;
if {Command.BUNO} in {?SelectedBUNOs} then
false
else
(
suppressedCount := suppressedCount + 1;
true;
)
and this is from the GH2 display formula:
Global NumberVar suppressedCount;
Local NumberVar numberEvents := {#RTotal3} - suppressedCount;
Local StringVar numberEventsStr := ToText(numberEvents, 0) + ' occurrence(s)';
I still get "1 occurrence(s)". Does this problem stem from a timing issue between the execution time of the details and the GH2?
I had to change the logic to:
if ({Command.BUNO} in {?SelectedBUNOs}) then
1
else
0;
to get the correct total but this worked and it now seems rather straight forward. I didn't have to insert the formula into the report for this to work but I guess that the use of this formula in the display formula accomplished the same affect.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum