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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable choice with list box

Hi Everyone,

Attached is my example.  I have set some variables with the set that I need to include in the set analysis.  I can use them individually in the Static column as you can see, but when I try and make it based on what is in the Base field I can't get the syntax working.  Anyone got any ideas?

Just to be clear, when a user selects USA I want the vUSA variable to be used in the set analysis which would give {'USA'}.

Thanks

Gareth

1 Solution

Accepted Solutions
Not applicable
Author

Hi Gareth:

Try this expression for Choice:

=Sum(Visits) /  Sum({<Country={$(=Replace(Concat(DISTINCT Choice, ','), ' + ', ','))}>} TOTAL Visits)

Logic:  Have been extracting the unique "Country" values and using that list in Set analysis.

Thanks,

Narasimha K

View solution in original post

2 Replies
Not applicable
Author

Hi Gareth:

Try this expression for Choice:

=Sum(Visits) /  Sum({<Country={$(=Replace(Concat(DISTINCT Choice, ','), ' + ', ','))}>} TOTAL Visits)

Logic:  Have been extracting the unique "Country" values and using that list in Set analysis.

Thanks,

Narasimha K

Not applicable
Author

Thanks mate this works a treat!