Focal Point
[SOLVED]Rename ACROSS column name

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

January 26, 2012, 12:05 PM
Rodney Chan
[SOLVED]Rename ACROSS column name
I was wondering if its possible to rename an ACROSS column name?

For example

ACROSS LICLASS AS ' ' COLUMNS COL1 AND COL2

What if i wanted to rename COL1 & COL2 to like Results 1, Results 2

Thank you

This message has been edited. Last edited by: Rodney Chan,


WebFOCUS 7.6
Windows, All Outputs
January 26, 2012, 12:56 PM
njsden
The issue here is that COL1 and COL2 are not really "columns" from a data standpoint but different value instances of the LICLASS field.

So, for you to use different values you'd need to DEFINE them in a different field and use the latter in your ACROSS.

DEFINE FILE blah
NEW_LICLASS/A20 = DECODE LICLASS ('COL1' 'Results 1' 'COL2' 'Results 2' ELSE 'Other');
END

TABLE FILE blah
SUM stuff
ACROSS NEW_LICLASS AS '' COLUMNS 'Results 1' AND 'Results 2'
END




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
January 26, 2012, 01:02 PM
njsden
Another option you may look into would be to HOLD your results first and then report out of it using fixed columns to which you can assign any title you want.

Something like this (not tested):

TABLE FILE blah
SUM STUFF
ACROSS LICLASS AS 'RESULT_'
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HDATA
END

-*
TABLE FILE HDATA
PRINT RESULT_COL1 AS 'Results 1'
      RESULT_COL2 AS 'Results 2'
END



The trick here is to rely on SET ASNAMES = ON and the effect it has when creating HOLD files out of TABLE FILE statements that use ACROSS.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
January 26, 2012, 01:26 PM
jsmark
In 7702 and above this works:

TABLE FILE CAR
SUM RC ACROSS COUNTRY AS '' COLUMNS FRANCE AS 'Result1' AND ENGLAND AS 'Result2'
END
January 26, 2012, 04:33 PM
Waz
quote:
COLUMNS FRANCE AS 'Result1' AND ENGLAND AS 'Result2'


Wow, learn something new every day.

Good One


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 27, 2012, 02:26 AM
ChristianP
HI,
we use 7702 and the code does not work!!

Regards

Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
January 27, 2012, 05:02 AM
Kofi
quote:
TABLE FILE CAR
SUM RC ACROSS COUNTRY AS '' COLUMNS FRANCE AS 'Result1' AND ENGLAND AS 'Result2'
END

It be working in 7.7.03

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
January 27, 2012, 08:04 AM
njsden
Nice! It does work in 7.7.03.

Rodney may still need to use some of the provided workarounds for his 7.6 environment.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
January 27, 2012, 04:25 PM
Rodney Chan
Boo thats what i was looking for!

quote:
TABLE FILE CAR
SUM RC ACROSS COUNTRY AS '' COLUMNS FRANCE AS 'Result1' AND ENGLAND AS 'Result2'
END


I will go with the suggestion by njsden to just use a DEFINE file. Not quite exactly what i was needing but good enough

Thank you!


WebFOCUS 7.6
Windows, All Outputs