Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store a Running Total as a Variable 1

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I have a Sum Running Total for @MTDRunning that is located in a Group called GR1. Based on a Specific Group value, I would like to store this value and use it later in a calculation.

@Grp1 formula is:
Select {Account.Type}
Case "Revenue": 1
Case "CostOfSales": 2
Case "Expense": 3
Case "NonOperRev": 4
Case "NonOperExp": 5
Then my sum for the Running Total is displayed when.
If {@Grp1} = 2 then
"Production Profit"
and the Sum of the @RunningTotal is Displayed.

Is there a way to store this value (Sum of the @RunningTotal ) and use it at the Report Footer?
 
It is hard to tell what exactly you are using for the running total--whether it is an inserted running total and we don't know how it is set up or where it is located, but you can use a variable like this, placed in the same {@Grp1} section where your running total is located:

whileprintingrecords;
numbervar valforRF;
if {@Grp1} = 2 then
valforRF := {#YourRunningTotal} else
valforRF := valforRF;

Then in the report footer, use:
whileprintingrecords;
numbervar valforRF;

-LB
 
Sorry about the late response. That is perfect and did the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top