Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Variable choice with list box

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

2 Replies
Not applicable

Re: Variable choice with list box

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

Re: Variable choice with list box

Thanks mate this works a treat!

Community Browser