Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Carry forward a group total
Message
From
28/08/2008 18:25:16
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01342833
Message ID:
01342882
Views:
18
>>Is there a way to carry a group total (calculated in the group footer) forward into the footer for the next group so that it can be used in a calculation to provide the % change between the 2 groups?
>>
>>Suppose the report is grouped on year, with columns for each month. In the footer for 2008 we want the calculate the % change for jan08 over jan07.
>>
>>IE result = (jan08grouptotal - jan07grouptotal) / jan07grouptotal
>>
>>Thanks
>
>I guess you need to use a variable and set it using _VFP.SetVar in Group Footer OnExit expression.
>
>E.g. create a variable PrevTotal and set it to 0. You will set it to actual Total in the Group Footer OnExit.
>
>Also your totals would have to be variables as well for this to work, I think.
>
>Another way would be to create everything in SQL. Same thing, using derived tables, e.g.
>
>select Dec-Nov as DecDiff, Nov-Oct as NovDiff, etc. from (your actual select statement) InnerSQL

Can't seem to get this one to work. I created 2 variables julTotal and julPrior for July. julTotal sums jul and prints OK in the group footer. julPrior is initialized at 0 and is not reset. Tried _vfp.SetVar('julPrior',julTotal) in all the onentry and onexit values but all I ever get for its value is 0 or the total for the current detail band.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform