Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Slider with top range/expression in list box

Hi

i'm trying to do a slider with 2 variables something like a top 10 (mag as a dimension) after sales but a little bit complex:

- in the example attached i have 6 mag (mag 1, mag 2,...mag 6) and a slider with values 1..6

- i created a list box in wich i see all mag with rank <=first variable and another list box in wich i see all mag with rank <=second variable

- but what i want is a list box with (a combination between them): mag situated with rank in the range of these 2 variables ( for ex: v1 is 3 and v2 is 5 i want only mag with rank 3,4 and 5); a kind ok what v2 has and v1 hasn't


1list box has the expression:

=If(aggr(rank(sum(Sales)),mag)<=TOPN,mag,null())

2list box:

=If(aggr(rank(sum(Sales)),mag)<=TOPN1,mag,null())

what expression should i have to obtain dimensions with rank in range between TOPN-TOPN1?

thanks

Cosmin


1 Solution

Accepted Solutions
Not applicable
Author

Hi cosmin,

i think you can use an expression like this one:

=If(aggr(rank(sum(Sales)),mag)>=TOPN and aggr(rank(sum(Sales)),mag)<=TOPN1,mag,null())

the ">=TOPN" and "<=TOPN" work fine in a listbox. Nevertheless I prefer the Dollarsign-expansion for variables. (see online help for more details).

The formula is then:

=If(aggr(rank(sum(Sales)),mag)>= $(TOPN) and aggr(rank(sum(Sales)),mag)<= $(TOPN1),mag,null())

and works now also as a calculated dimension and more.

HTH

Roland

P.S.:

I had some troubles with your values because you are using the comma "," as DezimalSep.

View solution in original post

2 Replies
Not applicable
Author

Hi cosmin,

i think you can use an expression like this one:

=If(aggr(rank(sum(Sales)),mag)>=TOPN and aggr(rank(sum(Sales)),mag)<=TOPN1,mag,null())

the ">=TOPN" and "<=TOPN" work fine in a listbox. Nevertheless I prefer the Dollarsign-expansion for variables. (see online help for more details).

The formula is then:

=If(aggr(rank(sum(Sales)),mag)>= $(TOPN) and aggr(rank(sum(Sales)),mag)<= $(TOPN1),mag,null())

and works now also as a calculated dimension and more.

HTH

Roland

P.S.:

I had some troubles with your values because you are using the comma "," as DezimalSep.

Not applicable
Author

Hi Roland

many thanks for help; very very useful

to go a little bit further a have one more challenge to this situation: i want to create a new slider like this but with percents in which i want to select for example: first 20% or the middle part 30%-->60% (not the ranks as number)

imagine all mag sorted after sales and a column with their share in total; when i select in slider 20%-->60% i want a selection with all mag situated in this range

mag 1 20%

mag 2 10%

mag 3 5%

...      sum=100%

slider selection 30% -35%  ----  mag 1, mag 2

slider selection 0-20% (top 20% ) --- mag 1

thanks again

Cosmin

ps: first time i tried in list box $(TOPN) but it didn't work