Focal Point
ACROSS with COMPUTEd columns

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

November 25, 2009, 03:23 PM
gmal
ACROSS 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


WebFocus 762,7611, 7.7.02 XP for Dev/test; Linux Prod 7.6.2; MRE
November 25, 2009, 04:05 PM
N.Selph
DEFINE instead of COMPUTE your MYMON column. Then do the ACROSS on MYMON instead of MONTH.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
November 27, 2009, 12:51 PM
JohnB
In 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


WF 7.7.03, Windows 7, HTML, Excel, PDF