Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Income Statement
Message
From
03/01/2009 10:56:05
 
 
To
03/01/2009 02:39:21
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01370795
Message ID:
01370835
Views:
16
>Unless I've missed something ..... Before you run the report you can "create a memory variable which sums up the total sales categories."
>SELECT SUM(sales) FROM myCursor INTO ARRAY aSalesTot
>
>aSalesTot will be in scope when you run the report.
>
>

Don't forget the GROUP BY category clause to seperate the categories to different array positions. Also the ORDER BY clause is needed to insure a known order of the array. In the Field List section, add the Category field so you can locate the right position in the array.

>
>
>>Thank you but I want to create a memory variable which sums up the total sales categories.
>>example:
>>
>>sales cat 1 521.00 1.57%
>>sales cat 2 6525.00 19.66%
>>sales cat 3 3625.00 10.92%
>>sales cat 4 22512.00 67.84%
>>
>>Total Sales 33183.00 100.00%
>>
>>expense cat 1 2252.00 6.79%
>>expense cat 2 2525.00 7.61%
>>expense cat 3 3987.50 12.02%
>>expense cat 4 2365.52 7.13%
>>Total expenses 11130.02 33.54%
>>
>>Net Profit (Loss) 22052.98 66.46%
>>
>>In this case, the total for all sales is 33183.00. That amount will become the denomenator for all the ratio calculations in the report.
>>
>>521.00 / 33183.00 = 1.57%
>>33183.00 / 33183.00 = 100.00%
>>3987.50 / 33183.00 = 12.02%
>>22052.98 / 33183.00 = 66.46%
>>and so on.
>>
>>I believe the calculation must be made in an additional detail band, but I am having trouble obtaining my desired result.
>>
>>GSD
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform