Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

vidyasagar159
Contributor

How to assign drop value to a variable?

Hi,

Hope you guys are doing great. I want to assign a drop-down value to one of the rank expression.

Load Script:

Rank_Table:

load * inline

[

dim,Rank

Top5,5

Top10,10

Top15,15

Top20,20

Top25,25

];

Drop Down: So when I select Top5, 5 has to apply to the below dimension expression.

dropdown.png

Dimension Expression:

=if(aggr(rank(sum(FUNDBALANCE)),PLANYEAR,COMPANY)<=VARIABLE,aggr(rank(sum(FUNDBALANCE)),PLANYEAR,COMPANY))

Thanks in advance!!

1 Solution

Accepted Solutions
vidyasagar159
Contributor

Re: How to assign drop value to a variable?

Actually, I found this issue long time back but forgot to update.

All I need to update this in a Measure expression and NOT in the dimension.

sum({$<company={"=aggr(rank(sum(FUNDBALANCE)),PLANYEAR,COMPANY)<=VARIABLE"}>}fundbalance)

6 Replies

Re: How to assign drop value to a variable?

Have you tried this

=if(aggr(rank(sum(FUNDBALANCE)),PLANYEAR,COMPANY)<=Rank, aggr(rank(sum(FUNDBALANCE)), PLANYEAR, COMPANY))

vidyasagar159
Contributor

Re: How to assign drop value to a variable?

Yes. I tried it. Only Top5 is working. Getting empty records when Top10 and above are getting selected.

Re: How to assign drop value to a variable?

Would you be able to share a sample?

vidyasagar159
Contributor

Re: How to assign drop value to a variable?

Please find the sample images below.

Top5:

Top5.PNG

Top10:

Top10.PNG

Re: How to assign drop value to a variable?

I see the problem, but can't really test anything . May be someone else can have better ideas

vidyasagar159
Contributor

Re: How to assign drop value to a variable?

Actually, I found this issue long time back but forgot to update.

All I need to update this in a Measure expression and NOT in the dimension.

sum({$<company={"=aggr(rank(sum(FUNDBALANCE)),PLANYEAR,COMPANY)<=VARIABLE"}>}fundbalance)

Community Browser