Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Carry forward a group total
Message
 
 
To
28/08/2008 17:03:50
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01342833
Message ID:
01342835
Views:
17
>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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform