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] 9 where statements for 9 checked boxes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] 9 where statements for 9 checked boxes
 Login/Join
 
Platinum Member
posted
Hi,
I have been searching and have not been able to find a case identical to mine. I have 9 boxes a user can check. The boxes represent the different types of owners that are in the database. If more than one box is checked, I want all the records that meet one or more of the checked boxes. so all my where statements would need an 'OR' between each one. However, I cannot use foc_none because then the whole line is ignored when it sees a single foc_none. If they check one box, they don't need an 'or'. But if they check 3 boxes, I need a where statement for each box separated by 'OR'. It is handling the OR I am having a problem with. The only thing I could come up with is to have a counter and increase it once I add the second where statemnt, thus I can code an 'OR' in there if the cntr is greater than 1. I am using dialog mgr to navigate around each statement. Any other suggestions or better ideas?

Thank you.

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


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report This Post
Expert
posted Hide Post
Generate the WHERE statement dynamically in Dialogue Manager checking all of your conditions and then use that variable in the TABLE part.


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
Virtuoso
posted Hide Post
Just make sure that each separate OR criteria is on its own line. A 'FOC_NONE' doesn't cause the whole WHERE to be ignored only the single PHYSICAL line of code in which it appears.

WHERE
fieldname EQ 'value'
OR fieldname EQ 'value'
.
.
.
;


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
You could use IN instead of OR
e.g.

WHERE fieldname IN (
&var1
&var2
&var3
)

You can then use FOC_NONE as long as at least one &var has a value.


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Platinum Member
posted Hide Post
Darin,
Thank you for your input. I did have each filter on it's own line using foc_none and my output results were not correct. It did occur to me my first two screening conditions, one of them would always be used. There is only one business size check box on the html. Therefore, I could prefix the rest of the filters with 'or'. Here is what I did. Ginny, thanks for your suggestion. Being the end of the day, sometimes I need another set of eyes.

-SET &WHERE1=IF &COMPANY_SMALL_BUSINESS EQ 'YES' THEN 'WHERE (COMPANY_SMALL_BUSINESS EQ ''YES'')' ELSE ' ';
-SET &WHERE2=IF &COMPANY_LARGE_BUSINESS EQ 'YES' THEN 'WHERE (COMPANY_LARGE_BUSINESS EQ ''YES'')' ELSE ' ';
-SET &WHERE3=IF &COMPANY_SDB EQ 'YES' THEN 'OR (COMPANY_SDB EQ ''YES'')' ELSE ' ';
-SET &WHERE4=IF &COMPANY_8A EQ 'YES' THEN 'OR(COMPANY_8A EQ ''YES'')' ELSE ' ';
-SET &WHERE5=IF &COMPANY_WOMAN_OWNED EQ 'YES' THEN 'OR(COMPANY_WOMAN_OWNED EQ ''YES'')' ELSE ' ';
-SET &WHERE6=IF &COMPANY_VETERAN_OWNED EQ 'YES' THEN 'OR(COMPANY_VETERAN_OWNED EQ ''YES'')' ELSE ' ';
-SET &WHERE7=IF &COMPANY_HUB_ZONE EQ 'YES' THEN 'OR(COMPANY_HUB_ZONE EQ ''YES'')' ELSE ' ';
-SET &WHERE8=IF &COMPANY_HBCU EQ 'YES' THEN 'OR(COMPANY_HBCU EQ ''YES'')' ELSE ' ';
-SET &WHERE9=IF &COMPANY_FOREIGN EQ 'YES' THEN 'OR(COMPANY_FOREIGN EQ ''YES'')' ELSE ' ';
-SET &WHERE10=IF &COMPANY_MINORITY EQ 'YES' THEN 'OR(COMPANY_MINORITY EQ ''YES'')' ELSE ' ';
-SET &WHERE11=IF &COMPANY_DIS_VET EQ 'YES' THEN 'OR(COMPANY_DIS_VET EQ ''YES'')' ELSE ' ';
-SET &WHERE12=IF &COMPANY_NON_PROFIT EQ 'YES' THEN 'OR(COMPANY_NON_PROFIT EQ ''YES'')' ELSE ' ';
-SET &WHERE13=IF &COMPANY_NATIVE_AMERICAN EQ 'YES' THEN 'OR(COMPANY_NATIVE_AMERICAN EQ ''YES'')' ELSE ' ';
-SET &WHERE14=IF &COMPANY_ALSAKAN_NATIVE EQ 'YES' THEN 'OR(COMPANY_ALSAKAN_NATIVE EQ ''YES'')' ELSE ' ';
-SET &WHERE15= ';';
-*
Have a super fantastic day!

Kathy

This message has been edited. Last edited by: Kathy P,


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
 
Posts: 118 | Location: Livonia, MI | Registered: March 27, 2009Report 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] 9 where statements for 9 checked boxes

Copyright © 1996-2020 Information Builders