Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
polisetti
Creator II
Creator II

Issue with Multiple Selection Trigger with Strings containing Spaces

Hi Everyone,

I'm trying to create a trigger that will select certain values in one field if no value is selected in Product Filter and if User selects multiple values the condition will go to the else statement.


The general format for a search string mask is (AAA|BBB|CCC) and if we are selecting these values then it is working fine.

However, if any of the values have spaces (PRD AAA|PRD  BBB|PRD CCC) , the search mask doesn't seem to work.


Below is the expression using in triggers:

=if(GetSelectedCount(PRODUCT_NAME)=0,MinString({<COMPETITOR_FLAG={'N'}>}PRODUCT_NAME),

'(' & getfieldselections(PRODUCT_NAME,'|') & ')')

Thanks in Advance

1 Solution

Accepted Solutions
polisetti
Creator II
Creator II
Author

Thank you Nagaraj,

I tried the syntax and its is working fine. However, I tried with below logic and it seems to be working.

=if(GetSelectedCount(PRODUCT_NAME)=0,MinString({<COMPETITOR_FLAG={'N'}>}PRODUCT_NAME),'("' &Replace(GetFieldSelections(PRODUCT_NAME),', ','"|"') & '")')

Regards,

Jaswanth P

View solution in original post

2 Replies
tamilarasu
Champion
Champion

Hi Jaswanth,

I have not tested the below one but try


=if(GetSelectedCount(PRODUCT_NAME)=0,

       MinString({<COMPETITOR_FLAG={'N'}>}PRODUCT_NAME), 

       '(' & Chr(34) & getfieldselections(PRODUCT_NAME, Chr(34) & '|' & Chr(34)) & Chr(34) & ')'

    )


                                                    OR


=if(GetSelectedCount(PRODUCT_NAME)=0,

       MinString({<COMPETITOR_FLAG={'N'}>}PRODUCT_NAME),

       '(' & Chr(34) & getfieldselections(PRODUCT_NAME, '"|"') & Chr(34) & ')'

    )


polisetti
Creator II
Creator II
Author

Thank you Nagaraj,

I tried the syntax and its is working fine. However, I tried with below logic and it seems to be working.

=if(GetSelectedCount(PRODUCT_NAME)=0,MinString({<COMPETITOR_FLAG={'N'}>}PRODUCT_NAME),'("' &Replace(GetFieldSelections(PRODUCT_NAME),', ','"|"') & '")')

Regards,

Jaswanth P