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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

substract value from variable in modifier set analysis

I have a variable called reportyear. With that I make this expression count({<year= {$(reportyear) }>} customerid)

I want to compare the outcome with previous year, to prevent making a lot of variables i am looking for a possibility to substract a value from the variable in the modifier for example:

count({<year= {"=$(reportyear) -1"}>} customerid) 

That does not give the expected result, any hints ?

 

Qlikview version may 2021 SR1

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You may use: count({<year= {"$(=$(reportyear) -1)"}>} customerid)

whereby it might be also possible to avoid the variable itself, with something like:

count({<year= {"$(=max(year) -1)"}>} customerid)

View solution in original post

2 Replies
marcus_sommer

You may use: count({<year= {"$(=$(reportyear) -1)"}>} customerid)

whereby it might be also possible to avoid the variable itself, with something like:

count({<year= {"$(=max(year) -1)"}>} customerid)

curiousfellow
Specialist
Specialist
Author

Thank you Marcus that worked. max(year) does not work here because it is not the last year of my dataset.