November 25, 2009, 03:23 PM
gmalACROSS with COMPUTEd columns
I used a COMPUTE to convert numeric months to alpha words,a nd need to ACROSS those words, but it will only across with the original numeric value. How do I relabel the column names?
I have:
SET ASNAMES = ON
TABLE FILE DM_SUMM_METRIC
SUM
'DM_SUMM_METRIC.DM_METRIC_SUMMARY.TOTAL_CHARGE_AMT'
BY 'DM_SUMM_METRIC.DM_PAYOR.PAYOR_CATEGORY'
ACROSS MONTH
COMPUTE MYMON/A5 = DECODE DM_SUMM_METRIC.DM_TIME.MONTH( 1 Jan 2 Feb 3 Mar 4 Apr 5 May 6 June 7 July 8 Aug 9 Sept 10 Oct 11 Nov 12 Dec ELSE unk );
The grid is fine and the result is fine, but I need column labels.
Update: my localhost is now 7.6.10
November 25, 2009, 04:05 PM
N.SelphDEFINE instead of COMPUTE your MYMON column. Then do the ACROSS on MYMON instead of MONTH.
November 27, 2009, 12:51 PM
JohnBIn case this may be of any help, the reason DEFINEs would work and COMPUTEs didn't is that DEFINES are processed before the summing and sorting, whereas COMPUTEs are processed after the summing and sorting.
Regards,
John