Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I store the result of a group in a variable?
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00454520
Message ID:
00454638
Views:
21
>If in a report, I created a group, for example, group by month of a date field.
>Then I sum a price field, can I put the different sum of different month into a variable so I can use them in a formula at the bottom of the report?
>For example,
>Jan
>Mr. A $10000
>Mr. B $20000
> Sum1= 30000
>Feb
>Mr. A $2000
>Mr. B $3000
> Sum2= 5000
>----------------------------
> X = Sum1*0.4 + Sum2*0.6 <----- Do some operation by using the sum.
>How can I obtain sum1 and sum2?


Create 12 different report variables. Mark each of them as SUM and use the following expressions:
*Sum1
IIF(MONTH(yourdatefield)=1, yourdollarfield, 0)

*Sum2
IIF(MONTH(yourdatefield)=2, yourdollarfield, 0)

etc.
That should get you what you want.

Cathy
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Reply
Map
View

Click here to load this message in the networking platform