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: 
sandhyag
Contributor
Contributor

Qliksense visualzation

Hello Everyone,

         I am trying to build a visualization using the Variable Input present in the QlikSense Dashboard Bundle.

My question is I have a column called Year. So when I use the Variable Input and if I give 1 then it should show me 2019 and when I give 2 it should show me 2019 and 2018. If I type 3 then it should show me 2019,2018,2017 and so on. I don't want to do it manually.

 

I tried an expression by creating a variable vV1 = 1

Then used that variable in the expression as if($(vV1)=1 ,(max(year)), I am getting the solution as 2019 but When I am trying to give the second expression as if($(vV1)=2,(max(year)-1) and also I should get max(year).

 

Please suggest some solution. Thanks.

 

2 Replies
Lisa_P
Employee
Employee

I think you are complicating this.

Try this for Year column:
= max(year) - $(vV1) + 1

sandhyag
Contributor
Contributor
Author

Hi Lisa, 

 

   I am trying to get both 2019 and 2018 in one calculation. 

 

 

Like max(year) and (max(year)-1) in one calculated  condition