General information
Category:
Reports & Report designer
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only