Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
egbert_jones
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
acsaggar
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
neelamsaroha157
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
egbert_jones
New Contributor II

Re: Variable defined buckets and user input

Thanks - what about the set analysis expression ?

Highlighted
neelamsaroha157
Valued Contributor II

Re: Variable defined buckets and user input

A little tweak in variable:

Capture1.JPG

Dimension & Expressions:

Capture.JPG

Highlighted
acsaggar
New Contributor II

Re: Variable defined buckets and user input

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