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     [CLOSED] How to pass multiple values into the CONTAIN and LIKE operator

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to pass multiple values into the CONTAIN and LIKE operator
 Login/Join
 
Guru
posted
Hi,

Can we pass multiple values[say text values - ABC,XYZ] into the CONTAIN and the LIKE operator.

Any hints/examples on the same would be helpful.

Thanks a lot in advance!

Regards,
IP

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


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Master
posted Hide Post
You can use OR conditional operator for filtering on multiple values. Try below code.

APP PATH IBISAMP
TABLE FILE CAR
BY COUNTRY
WHERE COUNTRY LIKE '%J%' OR '%Y%' OR '%W%';
END


Thanks,
Ram

This message has been edited. Last edited by: Ram Prasad E,
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
Hi,

Thanks Ram for the quick response and for the solution but I want to know how to pass the &variable from the html page to the fex using Contain or like operator.

Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Master
posted Hide Post
In case of multi value parameters for LIKE operator, you need to convert J,Y,W to '%J% OR '%Y%' OR '%W%' to use in filter. I doubt if its possible to pass it directly.

Even in RDBMS in case of multi values for LIKE, you have to break it into 2 conditions using OR clause as below.

column_1 like '%abc%' or column_1 like '%xyz% or etc.

Hope this helps.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
Hi,

Please let me know how to pass multiple values from the html page to the fex.
Also let me know the use of APP PATH IBISAMP
in the above step you had mentioned.

Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
Hi,

Would you mind sharing some sample example using CAR file.Thanks!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Master
posted Hide Post
If you use list box in html page, then check its property to enable multiple. By default multiple selection from the list box will be passed as comma separated like abc, xyz,etc.


By using APP PATH IBISAMP, I force WF engine to search for CAR master file within IBISAMP folder.

Thanks,
Ram
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Master
posted Hide Post
Refer to my first post for sample using car file.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Member
posted Hide Post
If you have an unknown number of values being passed in you could set up a -REPEAT statement from 1 to no_vals variable with first command

-REPEAT LOOP &CNT from 1 TO &SELECT0
-SET &CODE = IF &CNT EQ Q THEN 'WHERE COUNTRY CONTAINS ''&SELECT&CNT.EVAL'''
- ELSE ' OR ''&SELECT&CNT.EVAL'''
&CODE.EVAL
-LOOP

Not in Webfocus at present (so the syntax might not be 100%) but this technique should work and does work on multi select dropdowns.

Regards, David


Webfocus Release 7.6.11
Unix
EXL2K
 
Posts: 5 | Location: Rhodes | Registered: October 27, 2013Report This Post
Silver Member
posted Hide Post
We do this on a couple of Reports.
It ,might not be the prettiest way of doing things but it will work

 
TABLE FILE CAR
PRINT 
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
WHERE CAR.ORIGIN.COUNTRY CONTAINS &COUNTRY.VALIDATE.;
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
 


Note: The Parameter doesn't contain the quotes around it even though it is an Alpha field.

Then in the Parameter, the User can type (exactly as shown below)
'GLA' OR 'RAN'

This bring up England and France.


WF 81.5, Windows7
AS/400 Database.
All Outputs

 
Posts: 46 | Registered: November 26, 2008Report This Post
Guru
posted Hide Post
Hi,

Ram,Davidcl6 and Rogerwilkouk - I will try it and will let you know how it works.

Thanks a lot!

Regards,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Virtuoso
posted Hide Post
IP,

Here is a suggestion:

  
-SET &ECHO=ALL;
-* File info4pals02.fex
-DEFAULT &PARM='TIRE,BRAKE,WHEEL'
-* Length of params
-SET &PLEN=&PARM.LENGTH;
-* Strip the commas
-SET &PARMC=STRIP(&PLEN,&PARM,',','A&PLEN');
-* Length without the commas
-SET &ALEN=ARGLEN(&PLEN, &PARMC, 'I3');
-* Number of commas
-SET &CLEN=&PLEN - &ALEN;
-TYPE &PLEN &ALEN &CLEN
-* Length after replacing commas with ' OR '
-SET &OLEN=&PLEN + 5*&CLEN;
-* Replace commas
-SET &P=STRREP (&PLEN, &PARM, 1, ',', 6, ''' OR ''', &OLEN, 'A&OLEN.EVAL');
-SET &P='''' | &P ||'''';
-* Run the procedure
TABLE FILE CAR
SUM SALES
BY COUNTRY 
BY STANDARD
IF STANDARD CONTAINS &P
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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     [CLOSED] How to pass multiple values into the CONTAIN and LIKE operator

Copyright © 1996-2020 Information Builders