Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Percentage calculation in expression of report
Message
 
 
To
30/11/2001 12:39:36
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00588031
Message ID:
00588143
Views:
27
Hi Jay,
I think I know what I am doing wrong, the problem is how do I fix it! :)
the calcrpt() is used for each row on the report so what I need is the sum of the calcrpt() which is done at the end of the report. How would I code for that? Something to the effect of the following?
( SUM(calcrpt()) / ( SUM(calcrpt()) + myTable.field + myTable.field2 ) ) * 100

Thanks again!
Max


> Max --

> Nothing leaps to mind...

> A couple areas:
1. Test if it's a calculation issue.
From what you describe, I think it would be easy to separate the function from the report and test to see with specific input if you're getting the output you expect.

> SET DEFAULT TO (Drive\Path\PrgContainingCalcRpt)
USE myTable
GO TOP
? ( calcrpt() / ( calcrpt() + myTable.field + myTable.field2 ) ) * 100

> 2. Test if it's a display issue.
If your denominator values are large, it's possible that the 2 decimal places you have defined for the report field won't display anything. Expand to a few more decimal places and see if you get some result.

> Confirm that you have your display field set up appropriately.

> HTH,

> Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform