Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Carry forward a group total
Message
 
 
À
28/08/2008 17:03:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01342833
Message ID:
01342835
Vues:
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
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform