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 conditions
 Login/Join
 
<mohith>
posted
How do I write dynamic where conditions?
For example:
A report parameter could be (1,2) or (1,2,3) depending on which I need to pick records up.

TABLE FILE TEST
PRINT *
WHERE EMP_ID IN <PARAMETER CONDITION>
END

Please help!!!!
 
Report This Post
Platinum Member
posted Hide Post
J
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Just add few conditions.
Example Code:
Set the where conditions first:
-SET &WHERE1='';
-SET &WHERE2='';

-IF &HID_REGION EQ 0 THEN GOTO ALLREG;
-SET &WHERE1='AND REG_REGIONID IN ('||&HID_REGION1 ||')';
-ALLREG
-IF &HID_LOCATION EQ 0 THEN GOTO ALLLOC;
-SET &WHERE2='AND LOC_LOCATIONID IN ('||&HID_LOCATION1 ||')';
-ALLLOC

Now apply this in your query:

TABLE FILE TEST
PRINT *
WHERE 1=1
&WHERE1
&WHERE2
END

Regards,
Cyril
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Expert
posted Hide Post
Hi mohith,

Has this issue regarding dynamic WHERE conditions been resolved?

Are you selecting parameters from a list-box or from a text field? I ran a search on Information Builders' online documentations and came across the following topic which may be of interest.

How to dynamically pass all field values to a WHERE clause?
http://techsupport.informationbuilders.com/sps/60721100.html

How to create a dynamic WHERE statement
http://techsupport.informationbuilders.com/sps/73641014.html

Creating Dynamic or Static HTML Dropdown Lists for &Variables using -PROMPT-type input http://techsupport.informationbuilders.com/tech/wbf/wbf_tcn_074.html

Dynamic WHERE with OR's do not get translated by FOCUS http://techsupport.informationbuilders.com/sps/73121062.html

You will need to have a userid/password to access these documents.

Hope this helps. Big Grin

Cheers,

Kerry
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders