Learner this is the easy way DEFINE FILE CAR sortorder/I1=IF COUNTRY IS 'W GERMANY' THEN 1 ELSE IF COUNTRY IS 'ENGLAND' THEN 2 ELSE IF COUNTRY IS 'FRANCE' THEN 3 ELSE IF COUNTRY IS 'CHINA' THEN 4 ELSE 5 ; END -RUN TABLE FILE CAR SUM SALES ACROSS sortorder NOPRINT ACROSS COUNTRY ...whatever else END .. the idea here is the NOPRINT concept It means 'do it, just don't tell me about it' and we've DEFINEd a variable to put your elements in order.
Tom's way works for GRAPH FILE, where NOPRINT doesnt seem to work. TABLE FILE CAR SUM SALES ACROSS COUNTRY COLUMNS 'W GERMANY' AND 'ENGLAND' AND 'FRANCE' AND ... you get the idea
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 14, 2008, 02:38 AM
Tony A
The alternative to hardcoding your values is to retrieve the values to be used in the COLUMNS or ROWS syntax and then repetatively read the values in to build your code. Have a look at this article for the idea.
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
August 14, 2008, 02:50 PM
Learner
Thank you Tom and Susannah and Tony,
After viewing your suggestions and putting into my code, it is working exactly the way i want it. I have used Susannah method because it works better in my program.. Thanks Susannah for the solution. Very much appreciate.
Simon
WebFOCUS 7.1.6 on Win 2K/IIS 6/ISAPI HTML
August 15, 2008, 07:32 AM
susannah
you're most welcome, California, now please go to your 'Personal Zone' , 'Profile', and edit the signature block in that profile, so that we know what your system/version is , or are. -S.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 15, 2008, 04:29 PM
GCohen
Just for the record I would like to provide a simple example so you see easy it is to use the 'columns' feature. TABLE FILE CAR SUM SALES ACROSS BODYTYPE COLUMNS SEDAN AND COUPE AND WAGON AND WAGON BY COUNTRY END
Release 7.6.9 Windows HTML
August 15, 2008, 06:08 PM
Learner
Thanks GeraldCohen for the additional solutions. I gain so much after i joined this forum. It is very useful!
WebFOCUS 7.1.6 on Win 2K/IIS 6/ISAPI HTML
August 16, 2008, 10:18 AM
FrankDutch
Learner
The "columns" function gives you also the possibility to add a column even if there is no data available.
Just add an "non existing" item to see the result.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
August 16, 2008, 04:19 PM
susannah
wow. that is so handy to know... It would be amusing to know how exactly you tripped over that little factoid
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 17, 2008, 04:29 PM
Tony A
Susanahh,
That "little factoid" is mentioned in the link above.
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
August 17, 2008, 05:51 PM
j.gross
Yeah, COLUMNS creates a sort of Procrustean bed: lop off any uninvited values, and insert any no-shows.
- Jack Gross WF through 8.1.05
August 17, 2008, 10:10 PM
susannah
aha! i knew i had seen that somewhere before. thanks T. this is getting good , jg 1 : of, relating to, or typical of Procrustes 2 : marked by arbitrary often ruthless disregard of individual differences or special circumstances
i apologize to Learner for hijacking his thread..we get carried away sometimes.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
August 18, 2008, 11:12 AM
Doug
Did I miss something? Without the "SET HOLDLIST = PRINTONLY" (Or, is that the default setting at this installation?) I get the following:
ERROR AT OR NEAR LINE 22 IN PROCEDURE rowscommand (FOC015) THE TEST VALUE IS LONGER THAN THE FIELD FORMAT LENGTH: CONVERTIBLE CONVERTIBLE BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Adding the -SET &ECHO = ALL; reveals the following:
TABLE FILE CAR SUM CAR BY COUNTRY BY BODYTYPE ROWS 'CONVERTIBLE CONVERTIBLE' OVER 'COUPE COUPE' OVER 'HARDTOP HARDTOP' OVER 'ROADSTER ROADSTER' OVER 'SEDAN SEDAN' BY CAR NOPRINT END
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
August 18, 2008, 12:01 PM
j.gross
Susannah -
Actually more extreme than Procrustes -- he would either stretch or shorten his visitors; COLUMNS may do both