As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
SET ACROSSPRT = COMPRESS
DEFINE FILE CAR
TITLE/A100 = DECODE SEATS(4 'Four Wheeler', 2 'Two Wheeler' ELSE 'Other');
END
TABLE FILE CAR
PRINT CAR MODEL
ACROSS TITLE
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
I don't see how you expect to have different column titles over the same columns without using ACROSS.
The example you linked doesn't do anything like what you describe. I suggest you provide an example of the output you are looking for.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Hi, If the value that decided what will be the column title is a variable then -SET &COL_NAME = IF &variable EQ '2' THEN 'Two Wheeler' ELSE - I F&variable EQ '4' THEN 'Four Wheeler' ELSE 'Others';
TABLE FILE CAR PRINT CAR MODEL BY SEAT AS '&COL_NAME.EVAL';
END
If it is a field then read the field value in a Variable and then use the above code.
WF 8.2.04 Windows/Unix All Formats In Focus since 2006
Posts: 74 | Location: UK | Registered: September 17, 2018
Thats what the problem is. Its not a variable but a field from mas and if taken in DEFINE then wont be able to use field for title as title can be customized at runtime by variable and not by field.
Ashwini, You can read the values of the filed in a variable and then set you variable that is used in title accordingly.
TABLE FILE CAR
PRINT
COUNTRY
WHERE RECORDLIMIT EQ 1
ON TABLE SAVE AS READ_VALUE
END
-*Considering there is only 1 value for country
-RUN
-READ READ_VALUE &COL_VALUE.A10.
-*Considering the filed format is A10
-RUN
-SET &COLTXT = DECODE &COL_VALUE (1 'Just one passenger' 2 'Two-seater' 3 'Carries three' 4 'Four passengers' ELSE 'Famliy');
TABLE FILE CAR
PRINT
CAR
COUNTRY
BY SEAT AS '&COLTXT.EVAL'
END
WF 8.2.04 Windows/Unix All Formats In Focus since 2006
Posts: 74 | Location: UK | Registered: September 17, 2018
Ashwini, Did you understand the code or just copy pasted the code. the decode statement is working on the value from SEAT column. I have copid that from what GamP wrote.
Did you change your Decode statement to consider country value instead of SEAT?
When you apply SEAT where conditoin you get 4 different values, as per your original post you have only 1 value at any point.
I gave you a code sample for you to understand what GamP and I are trying to explain.
WF 8.2.04 Windows/Unix All Formats In Focus since 2006
Posts: 74 | Location: UK | Registered: September 17, 2018