Focal Point
Getting the percent of total columns

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

August 22, 2006, 11:19 AM
ETLProg
Getting the percent of total columns
I need some help getting the percentage of a column total.

Here is my code:

DEFINE FILE PROVIDERCLAIMFACT
RECPAY/D15.2=
IF
TRANSACTIONTYPECODE EQ 'P' OR 'A'
AND TRANSACTIONCATEGORYCODE NE 'CRA' OR 'DRA'
THEN TRANSACTIONAMT
ELSE 0;
RECIDEN/D15.2=
IF
( TRANSACTIONCODE EQ 'REFDUE' OR 'REC-REFDUE' )
OR ((TRANSACTIONCATEGORYCODE EQ 'DRA' OR 'CRA' ) AND ( TRANSACTIONCODE NE 'COR-CDEN' OR 'COR-PDEN' ))
THEN TRANSACTIONAMT
ELSE 0;
END
TABLE FILE PROVIDERCLAIMFACT
SUM
RECIDEN AS 'Identified Dollars'
BY YEARMONTHKEY AS 'Rec Iden Month'
SUM
RECPAY AS 'Recovery Pmt'
BY YEARMONTHKEY AS 'Rec Iden Month'
ACROSS HIGHEST YMKEY NOPRINT
ACROSS-TOTAL
ACROSS MONTHDES AS 'MONTH'
WHERE FULLDATE GE DT(&BeginDate);
WHERE FULLDATE LE DT(&EndDate);
WHERE REGIONKEY EQ ®IONKEY.(OR(FIND REGIONKEY IN VWERPTGEOGRAPHY)).Region.;
WHERE SERVICETYPEKEY EQ &SERVICEkey.(FIND SERVICETYPEKEY IN VWERPTGEOGRAPHY).SERVICEkey.;
ON TABLE SET PAGE-NUM OFF
ON TABLE COLUMN-TOTAL AS 'TOTAL' RECIDEN RECPAY


The output would looks something similar to this

July June
RECIDEN RECPAY RECPAY
200601 10 1 2
200602 10 1 2
200603 10 1 2

TOTAL: 30 3 6
What I want to do is get a percentage from total row; for example

Percentage: 10% (3/30) 20%(6/30)
Does anybody know of a way to do this? Note: I only need to display the percentage.


Any help is greatly appreciated!


Dev 7.1.4 WinNT SQL Server 2005 DB
Prod 7.1.4 WinNT SQL Server 2000 DB
August 22, 2006, 03:57 PM
Prarie
first you have to creat a percentage like
COMPUTE SHRINK/D8.2% = ((OS/SALES ) * 100)

Then you can do
ON TABLE RECOMPUTE

to get a total on percent...if I'm understanding your question.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Further to Prarie's comment, check this post:

Weighted Averages

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
The way to do a total column calculation is with the RECAP function formated inside of SUBFOOT. eg.

TABLE FILE CAR
SUM SEATS AND AVE.SEATS
BY COUNTRY
ON TABLE RECAP
SEATRATIO= AVE.SEATS/SEATS ;
ON TABLE SUBFOOT
"MY VALUES ARE <SEATS  <AVE.SEATS  <SEATRATIO "
END

This message has been edited. Last edited by: Kerry,


Release 7.6.9
Windows
HTML