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] Comma Separated Dynamic Autoprompt
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Comma Separated Dynamic Autoprompt
 Login/Join
 
Master
posted
Is there a way to pass a comma separated, list of text values (so each value need to be in single quotes) from an autoprompt?

I found this in the docs: How to Add a Dynamic Multiselect List of Values

In that I learned that you can use a comma instead of OR where it says:
quote:

operation
Specifies how to evaluate multiple values. May contain the value OR, AND, or a comma (,). If omitted, the default value is OR.


So I tried the following:
-TYPE &COUNTRY.(,(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.;

And do I get this returned with comma separated values:
 
ENGLAND , FRANCE , ITALY , JAPAN , W GERMANY; 

However it needs to have single quotes around each value like when OR is used:

-TYPE &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.; 
'ENGLAND' OR 'FRANCE' OR 'ITALY' OR 'JAPAN' OR 'W GERMANY'; 

This message has been edited. Last edited by: FP Mod Chuck,


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 547 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Try this instead:

 -TYPE &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.; 


WebFOCUS 8206, Unix, Windows
 
Posts: 1791 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Master
posted Hide Post
quote:
Originally posted by BabakNYC:
Try this instead:

 -TYPE &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.; 


Yes, I have that at the bottom of my post showing how the 'OR' separated list has single quotes around each item.

I need a comma (,) separated list with single quotes around each item

Currently I have to do the following:
  
-TYPE &|COUNTRY Before: &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.;
-SET &COUNTRY = IF &COUNTRY CONTAINS ''' OR ''' THEN TRIM_(BOTH, ' ', STRREP(&COUNTRY.LENGTH, &COUNTRY, 4, ' OR ', 2, ', ', &COUNTRY.LENGTH, '&COUNTRY.TYPE&COUNTRY.LENGTH') ) ELSE &COUNTRY;
-TYPE &|COUNTRY After: &COUNTRY;


And that returns:
 &COUNTRY Before: 'ENGLAND' OR 'FRANCE' OR 'ITALY' OR 'JAPAN' OR 'W GERMANY';
 &COUNTRY After: 'ENGLAND', 'FRANCE', 'ITALY', 'JAPAN', 'W GERMANY';
  


I am just wondering if it is possible to get the '&COUNTRY After' results listed above without STRREP manipulation. Since IBI does have the ability to do comma separated values by using a comma instead of 'OR', I was just wondering if it were possible to use this with alpha values as well as numeric to be able to utilize an IN statement without having to do some big ol' hairy function


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 547 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Sorry, I misunderstood. There's a simplified string function called REPLACE and that seems to be easier than STRREP.


 
-TYPE &COUNTRY.(OR(FIND CAR.ORIGIN.COUNTRY IN CAR |FORMAT=A10)).COUNTRY:.; 
-SET &NEW_COUNTRY= REPLACE(&COUNTRY, ' OR ', ',');
-TYPE COUNTRY: &COUNTRY
-TYPE NEW_COUNTRY: &NEW_COUNTRY 


WebFOCUS 8206, Unix, Windows
 
Posts: 1791 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Comma Separated Dynamic Autoprompt

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.