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: 
surajap123
Creator III
Creator III

expression help

Hi All,

The below expression doesn't work when there is space in the value.

eg- United States.

But works for all other values, eg- India, France, UK etc.

IF(GetSelectedCount(Country),'('&Concat(DISTINCT Country,'|') & ')','')

Please note that i have onSelect Trigger in the document settings. Here is the attached app. The purpose of trigger is to select fields that are unlinked.

Please help.

1 Solution

Accepted Solutions
effinty2112
Master
Master

Suraj,

Here's a workaround that might work:

=IF(GetSelectedCount(Country) > 0 ,'('& replace(Concat(DISTINCT Country,'|'),' ','?') & ')','')

found this in the forum from two years ago by a chap called Neil Miller so credit to him if it works.

Cheers

Andrew

View solution in original post

6 Replies
effinty2112
Master
Master

Hi Suraj,

Aren't we missing something in the condition?

Perhaps:

IF(GetSelectedCount(Country) > 0 ,'('&Concat(DISTINCT Country,'|') & ')','')

Should still work for Countries with spaces in the name.

Cheers

Andrew

antoniotiman
Master III
Master III

Hi,

try

IF(GetSelectedCount(Country),'('&Concat(DISTINCT Chr(39)&Country&Chr(39),'|') & ')','')

effinty2112
Master
Master

Hi Suraj,

                    Are you using the result as a search filter?

Andrew

surajap123
Creator III
Creator III
Author

Thanks for all the replies.

I have attached a sample app. I want the selections to happen on other field through Trigger.

This is just to connect both fields that are not linked by tables.

effinty2112
Master
Master

Suraj,

Here's a workaround that might work:

=IF(GetSelectedCount(Country) > 0 ,'('& replace(Concat(DISTINCT Country,'|'),' ','?') & ')','')

found this in the forum from two years ago by a chap called Neil Miller so credit to him if it works.

Cheers

Andrew

surajap123
Creator III
Creator III
Author

Thank you so much for your help Andrew.