Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic column names
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] dynamic column names
 Login/Join
 
<Sathish.B>
posted
When I run the below code I get only SEATS as column names, any idea how to get the CAR names in the column title

TABLE FILE CAR
SUM SEATS
BY COUNTRY
ACROSS CAR
ON TABLE HOLD AS TEMP
END
-RUN

TABLE FILE TEMP
PRINT *
END

This message has been edited. Last edited by: Kathleen Butler,
 
Reply With QuoteReport This Post
Expert
posted Hide Post
If you are going to hold your data prior to printing it out then there is no reason to use an across phrase - just use BY.

Once you have the held data, then report on it using the ACROSS phrase -
TABLE FILE CAR
SUM SEATS
BY COUNTRY
BY CAR
ON TABLE HOLD AS TEMPFILE
END
-RUN

TABLE FILE TEMPFILE
SUM SEATS
BY COUNTRY
ACROSS CAR
END


I take it that this is just an example of a much larger process as there is little point in holding the first extract to then report upon it, you might as well do it in one pass!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5682 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
<Sathish.B>
posted
Tony, i wanted an output in this format.

COUNTRY BMW BENZ AUDI
ENGLAND . 8 .
ITALY 9 . .
JAPAN 6 9 .

so that i can refer BMW, BENZ, AUDI as separate columns for further processing. Not sure if this is possible.
 
Reply With QuoteReport This Post
Expert
posted Hide Post
Sathish..
just don't hold the interim file, as T says.
the creation of special across names
'seaengland' 'seafrance' etc, is a very useful feature of webfocus, concatenating the first three letters of the measurename and the across field value. This will be very useful, as your programming talents grow.
If you must hold and retable, then
SET ASNAMES = ON
TABLE FILE CAR
SUM SEATS AS '' BY COUNTRY ACROSS CAR
ON TABLE HOLD
END
TABLE FILE HOLD PRINT *
END

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
<Sathish.B>
posted
Thanks a ton, this was the output i was looking for. will help me lot in my project.
 
Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
SET ASNAMES = ON
TABLE FILE CAR
SUM SEATS AS '' BY COUNTRY ACROSS CAR
ON TABLE HOLD
END
TABLE FILE HOLD PRINT *
END



Sorry for opening this way old thread...

But if I am making this as

 ON TABLE HOLD AS HLD1 FORMAT FOCUS 


Then the column names are not retained... Any SET commands to have that?


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
Guru
posted Hide Post
The thing is TITLE='', $ is how it is setting up in the master file it is creating for the focus mart.

Having an intermediate HOLD file resolved the issue.

This message has been edited. Last edited by: Ramkumar - Webfous,


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic column names

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.