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     [SOLVED] LT, GT or ALL in one parameter

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] LT, GT or ALL in one parameter
 Login/Join
 
Guru
posted
I have a report I want to add a parameter in this report where user should be able to select one option from fowlloing.

SHOW ME where COL1VALUE GT 0 First Option
SHOW ME WHERE COL1VALUE LT 0 Second OPTION
SHOW ME ALL

IS there any easy way to do this? I think I dont know how to change the comparison operator on the fly depending on users value selection.

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


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Virtuoso
posted Hide Post
See if this gives you some ideas.

 -SET &OPTION = &CTR.(ALL,GT,LT).OPTION.;
-SET &OPTION2 = IF &OPTION EQ 'ALL' THEN 'FOC_NONE' ELSE &OPTION;
TABLE FILE CAR
PRINT CAR SALES RETAIL_COST
WHERE SALES &OPTION2 RETAIL_COST;
END

 
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Guru
posted Hide Post
prarie Very nice job. LT and GT works just fine but when I try ALL I get following error message:

  
ERROR AT OR NEAR LINE     39  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: ALL
 BYPASSING TO END OF COMMAND
 (FOC009) INCOMPLETE REQUEST STATEMENT


This is my CODE:
WHERE FIELDNAME &OPTION 0;  


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Expert
posted Hide Post
Please note that Prarie used &OPTION2 in the WHERE clause. She had transformed ALL to FOC_NONE which causes the line with the WHERE clause not to be executed thereby giving you all the rows.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Guru
posted Hide Post
quote:
ABLE FILE CAR
PRINT CAR SALES RETAIL_COST
WHERE SALES &OPTION2 RETAIL_COST;

Thank you for pointing that out. It works. It my bad that I didnt see code carefully. I also tried the following and that worked too.Since I knew none of the value is going to be null so I used following code for all and it worked too. However, foc_none is better way to go just in case if in future we get null value in the field.

  SET &OPTION = &CTR.(<Positive,GT>,<Negitive,LT>,<ALL,IS>).OPTION.;
-*-SET &PASSVAL = IF &OPTION EQ 'GT' OR 'LT' THEN 0 ELSE 'NOT MISSING';


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Guru
posted Hide Post
I usually try to avoid mixing with DM codes. This makes GUI compatible.
WHERE (COLVALUE1 GT 0 AND '&OPTION' EQ 'FIRST') OR
      (COLVALUE1 LT 0  AND '&OPTION' EQ 'SECOND') OR
      ('&OPTION' EQ 'ALL')  


Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
 
Posts: 305 | Location: Winnipeg,MB | Registered: May 12, 2008Report 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     [SOLVED] LT, GT or ALL in one parameter

Copyright © 1996-2020 Information Builders