Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New 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
Highlighted
New Contributor II

Re: Variable defined buckets and user input

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.

 

Highlighted
Valued Contributor II

Re: Variable defined buckets and user input

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

Capture.JPG

Highlighted
New Contributor II

Re: Variable defined buckets and user input

Thanks - what about the set analysis expression ?

Highlighted
Valued Contributor II

Re: Variable defined buckets and user input

A little tweak in variable:

Capture1.JPG

Dimension & Expressions:

Capture.JPG

Highlighted
New Contributor II

Re: Variable defined buckets and user input

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