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] LT, GT or ALL in one parameter
Go
New
Search
Notify
Tools
Reply
  
[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, 2010Reply With QuoteReport 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, 2005Reply With QuoteReport 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, 2010Reply With QuoteReport 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, 2006Reply With QuoteReport 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, 2010Reply With QuoteReport 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, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.