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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Where Clause
 Login/Join
 
Member
posted
I have an input form that will allow the user to input different parameters. I want them to be able to enter only the ones they want and leave the others blank.

ex.

item_id = ________

color = __________

size = ___________

How would I set up the where clause in the fex to accept all of these paramters, but also leave any of them blank if the user only wants to narrow based on one or two of the parameters?
 
Posts: 25 | Location: VA | Registered: May 13, 2005Report This Post
Expert
posted Hide Post
Here's one solution, I'm sure others will be posted.

-SET &comm_it = IF &item_id EQ '' THEN '-*' ELSE '';
-SET &comm_co = IF &color EQ '' THEN '-*' ELSE '';
-SET &comm_si = IF &size EQ '' THEN '-*' ELSE '';

&comm_it WHERE ITEM_ID EQ '&item_id';
&comm_co WHERE COLOR EQ '&color';
&comm_si WHERE SIZE EQ '&size';

The &comm_** parameters will have the comment tag (-*) if the input parameter is blank.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
You will need to write some DM code for this.

It could look something like this:
-IF &ID EQ '' GOTO :NO_ID
WHERE ITEM_ID EQ &ID
:NO_ID

-IF &COLOR EQ '' GOTO :NO_COLOR
WHERE COLOR EQ &COLOR
:NO_COLOR

-IF &SIZE EQ '' GOTO :NO_SIZE
WHERE SIZE EQ &SIZE
:NO_SIZE
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Member
posted Hide Post
Francis,

If I do the code the way you recommended it works with one parameter. But when adding others it gives me an error saying '-*' is not recognized.

Here is the code I am using:

-SET &comm_GEO = IF &LOC EQ '' THEN '-*' ELSE '';
-SET &comm_SVC = IF &SVC EQ '' THEN '-*' ELSE '';
TABLE FILE Property
PRINT
Location
SVC_CD
INSTALLATION_CD
DESC
BY
Location
&comm_GEO WHERE Location EQ'&LOC'
&comm_SVC WHERE SVC_CD EQ'&SVC'

Any help is greatly appreciated.
 
Posts: 25 | Location: VA | Registered: May 13, 2005Report This Post
Expert
posted Hide Post
It does work for me, but try adding .EVAL. See the example below:

-SET &ECHO=ALL;
-SET &COUNTRY = '';
-SET &SALES = '5000';
-SET &SEATS = '';

-SET &COMM_CO = IF &COUNTRY EQ '' THEN '-*' ELSE '';
-SET &COMM_SA = IF &SALES EQ '' THEN '-*' ELSE '';
-SET &COMM_SE = IF &SEATS EQ '' THEN '-*' ELSE '';

TABLE FILE CAR
SUM SALES
BY COUNTRY
BY MODEL

&COMM_CO.EVAL WHERE COUNTRY EQ '&COUNTRY';
&COMM_SA.EVAL WHERE SALES GE &SALES;
&COMM_SE.EVAL WHERE SEATS GE &SEATS;
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thanks Francis. adding .EVAL took care of the problem
 
Posts: 25 | Location: VA | Registered: May 13, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders