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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How we can achieve by using alternative state

Hi,

I need to list the top 3 countries whose sales greater than sales of USA,here USA is selected from list box.Suppose if we select UK I need to display 3 countries whose sales greater than sales of UK....and so on.

List box contains 50 countries.

how we can achieve this output by using alternate state instead of set analysis.

Thanks

Swathi

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

yes

ok after loading the data

i created a list box and assigned it to alternate state

in this list box i allow only one selected value

the value in this list box is the reference country.

i than created a variable named vRefernceSale with this formula

=sum({Alternate1}Sales)

than in a straight table i chose country as the dimension

and used this expression

if(sum(Sales)>vRefernceSale,sum(Sales))

the last step is to define in the dimension limit

show 3 largest values

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

have a look at the attach example

Not applicable
Author

Oh unfortunately I am unable to open the qvw because I have personal edition in my desktop.Can you please share explanation here??

Thanks Swathi

lironbaram
Partner - Master III
Partner - Master III

yes

ok after loading the data

i created a list box and assigned it to alternate state

in this list box i allow only one selected value

the value in this list box is the reference country.

i than created a variable named vRefernceSale with this formula

=sum({Alternate1}Sales)

than in a straight table i chose country as the dimension

and used this expression

if(sum(Sales)>vRefernceSale,sum(Sales))

the last step is to define in the dimension limit

show 3 largest values

Not applicable
Author

Thanku Liron