Focal Point
Percent within subtotaled

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7371025152

October 12, 2007, 11:36 AM
Bethany
Percent 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


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
October 12, 2007, 02:22 PM
Gizmo
WHEELBASE 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.



Windows: WF 7.6.2: SQL Server 2008 R2
October 12, 2007, 04:23 PM
Bethany
I 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%


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
October 18, 2007, 10:29 AM
Kerry
Hi 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. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.