October 12, 2007, 11:36 AM
BethanyPercent within subtotaled
Please run this code and note that when you manually total the percents, the total is 100.1 not 100. I've tried many variations of field formats (P12, P12.2, D12....) for the percentage field as well as RECOMPUTE OR SUMMARIZE instead of subtotal for the ALL field, but in my report I still get subtotals at the COUNTRY level that end up totaling more than 100%.
Does anyone have a solution for this?
DEFINE FILE CAR
ALL/A3 = 'ALL';
END
TABLE FILE CAR
SUM
WHEELBASE
PCT.WHEELBASE WITHIN ALL AS 'PERCENT'
BY ALL
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL AS 'TOTAL'
ON ALL RECOMPUTE AS 'GRAND TOTAL'
END
Bethany
WF 7.1.3
DevStudio 7.1.4
October 12, 2007, 02:22 PM
GizmoWHEELBASE is in D format which keep more of the decimal places than what will be displayed.
Also, if you want the calculation to trully use packed, you need to redefine WHEELBASE to P12.1 or P12.2. Using packed format, your total will be less than 100.
October 12, 2007, 04:23 PM
BethanyI did the DEFINE to make WHEELBASE A P10.1, but now the total comes to 99.6%. Any way to get it to actually equal 100%
October 18, 2007, 10:29 AM
KerryHi Bethany,
Can you please try the following:
DEFINE FILE CAR
ALL/A3 = 'ALL';
END
TABLE FILE CAR
SUM
WHEELBASE
PCT.WHEELBASE
PCT.WHEELBASE/D8.4 WITHIN ALL AS 'PERCENT'
BY ALL
BY COUNTRY
BY CAR
ON COUNTRY SUBTOTAL AS 'TOTAL'
ON ALL RECOMPUTE AS 'GRAND TOTAL'
END
Note the first pct.wheelbase field shows only 1 decimal place, the second 4 decimals.
This is a rounding display issue.
Hope this helps.
Cheers,
Kerry