Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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!