We help IT Professionals succeed at work.

# Running Total Calculations

on
How can I create a running Total on my Report footer for the following calculation:

EvaluateAfter({@Total Group Scrap Time});
numberVar dur;
(dur * 41.58 / 3600) +({@Total Quantity of Scrap}*{PartMaster.MaterialCost})

Comment
Watch Question

## View Solution Only

Senior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
A running total by definition works on each record.  A formula in the report footer is only executed once so there is nothing to add up.

What is it you are trying to do?

mlmcc

Commented:
I think you basically want to produce a total of the result of that formula.  Do you actually want a running total, or just a grand total?  "Running total" sort of implies that you want to see the total as it's accumulated (every time something is added to it).  But all that you would normally see in the "report footer" would be the grand total.

Which is basically my long-winded way of asking the same question as mlmcc.  :-)

The answer is probably going to be to accumulate the total in a variable, which you could do in that same formula, but exactly how you handle it will depend on which type of total you want.

James

Commented:
All I would like is the total
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Can you right click it an insert a summary?

If not then you will have to do a manual total

In the report header declare a total variable in a formula
WhilePrintingRecords;
Global NumberVar myTotal;
""

EvaluateAfter({@Total Group Scrap Time});
numberVar dur;
Local numberVar dispValue;
Global NumberVar myTotal;

dispValue := (dur * 41.58 / 3600) +({@Total Quantity of Scrap}*{PartMaster.MaterialCost});
myTotal := myTotal + dispValue;
dispValue

In the report footer add a formula to display the total
WhilePrintingRecords;
Global NumberVar myTotal;
myTotal;

mlmcc