Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Carry forward a group total
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01342833
Message ID:
01343344
Views:
21
>>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
>
>
>Let's say you need 12 totals .... one for each month ...
>
>Create 24 report variables; rnJanPrev, rnFebPrev, ... rnDecPrev, rnJanCurr, rnFebCurr, ... rnDecCurr. For the "Prev" variables, set the initial value to 0, set the expression to 0, set the calculate option to SUM and have them reset at end of report. For the "Curr" variables, set the initial value to 0, the expression to whatever field you need, and reset at the data group.
>
>In the OnExit expression of the data group footer enter this:
>
>
>_VFP.SetVar('rnJanPrev', rnJanCurr) AND _VFP.SetVar('rnFebPrev', rnFebCurr) AND ... _VFP.SetVar('rnDecPrev', rnDecCurr)
>
>
>In the data group footer, print (rnJanCurr - rnJanPrev) / rnJanPrev ... and so on.

I think he tried this and it didn't work. Also you can not use AND with _VFP.SetVar, you need to use NVL function here...
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