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