Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] title of one field based on value of another field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] title of one field based on value of another field
 Login/Join
 
Member
posted
Hi

want to achieve something like below page.
https://www.informationbuilder...developers/PageBreak

but not through heading. is there any other way?
the requirement is
if SEATS field EQ 4 then
BY CAR AS 'Four Wheeler Car'

if SEATS field EQ 2 then
BY CAR AS 'Two Wheeler Car'

Note: consider that SEATS value will be single at a time and not known earlier. it can be anything.


Regards
Ashwini Rane

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
Virtuoso
posted Hide Post
Sounds like a job for DEFINE and ACROSS.
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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Member
posted Hide Post
Thanks Wep5622

No. It should not be separated by across.
Its a normal BY or PRINT and title of the field should be based on the value receiving for other field.

Regards
Ashwini Rane


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
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, 2018Report This Post
Virtuoso
posted Hide Post
Expanding that a bit, you could make it a loop. Like this:
-SET &SEATS = 0;
-:LABEL
-SET &SEATS = &SEATS + 1;
-IF &SEATS EQ 9 THEN GOTO :ENDOFFEX;

-SET &COLTXT = DECODE &SEATS (1 'Just one passenger' 2 'Two-seater' 3 'Carries three' 4 'Four passengers' ELSE 'Famliy');

TABLE FILE CAR
PRINT CAR AS '&COLTXT'
MODEL BODYTYPE SEATS
WHERE SEATS EQ &SEATS;
END
-GOTO :LABEL
-:ENDOFFEX

Just my 2 cents ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Thanks GamP and Addy.

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.

Regards
Ashwini Rane


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
Expert
posted Hide Post
quote:
I suggest you provide an example of the output you are looking for.

Yes, Please. Then we can assist you with this task.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
Hi Doug

The example is same as the example given in page break link provided. Just dont want handling in header.

Regards
Ashwini Rane


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
Gold member
posted Hide Post
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, 2018Report This Post
Member
posted Hide Post
quote:
WHERE RECORDLIMIT EQ 1


tried WHERE SEATS EQ 4 instead in filter
and still it went to else block and print Family.


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
Gold member
posted Hide Post
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, 2018Report This Post
Member
posted Hide Post
Hey,
Thanks GamP. the solution you provided worked with my example as well.


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 15, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] title of one field based on value of another field

Copyright © 1996-2020 Information Builders