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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
vidyasagar159
Creator II
Creator II

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
Creator II
Creator II
Author

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)

View solution in original post

6 Replies
sunny_talwar
MVP
MVP

Have you tried this

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

vidyasagar159
Creator II
Creator II
Author

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

sunny_talwar
MVP
MVP

Would you be able to share a sample?

vidyasagar159
Creator II
Creator II
Author

Please find the sample images below.

Top5:

Top5.PNG

Top10:

Top10.PNG

sunny_talwar
MVP
MVP

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

vidyasagar159
Creator II
Creator II
Author

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)