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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
egbert_jones
Contributor II
Contributor II

Variable defined buckets and user input

Looking to do the following but cant quite get it right. 

 

 

Player_ID,

If ( Score >= 100 ), 'Expert','Novice' as Skill_Level       //If score or points greater than 100 then 'Expert'                                                                                                                                                          otherwise novice

                                              

 

Then in the front end I have a set analysis expression which counts no of players based on this field 

=Num(COUNT({<Skill_Level ={'Expert'},DISTINCT Player_ID)

 

What I want is a variable driven user input box which allows the user to  enter  a value for the 'score' and for the set analysis to update given this value. 

5 Replies
acsaggar
Contributor II
Contributor II

create an input box. populate it with a variable 'vScore'

change your set expression for experts:

=Num(COUNT({<Skill_Level ={">=$(=vScore)}>"},DISTINCT Player_ID)

 

for novice:

 

=Num(COUNT({<Skill_Level ={"<$(=vScore)}>"},DISTINCT Player_ID)

May need to play with it incase I made a syntax error but it should work. The point is you can use less than or greater than a variable within the set analysis itself.

Your other methods is not going to work because you're using a variable calculated at script level. It needs to be calculated dynamically by the expression according to the user inputted variable value.

 

neelamsaroha157
Specialist II
Specialist II

You may create 2 variable as shown below and use vVar2 in your expression.

Capture.JPG

egbert_jones
Contributor II
Contributor II
Author

Thanks - what about the set analysis expression ?

neelamsaroha157
Specialist II
Specialist II

A little tweak in variable:

Capture1.JPG

Dimension & Expressions:

Capture.JPG

acsaggar
Contributor II
Contributor II

sorry it's score rather than skill_level field but same thing