Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Arithmetic with a variable

I'm sure this is rock-stupid, but I can't find the correct syntax anywhere.

I have a variable, vMaxYear. My expression

=

aggr(count({<Year={"$(vMaxYear)"}>} distinct dlogin),COC_Company)

works perfectly well to give me a count of "dlogin" by Company when the year = max year.

Now, I want to find out what happened in the previous year. I have tried "$(vMaxYear)-1", "$(vMaxYear-1)", "=$(vMaxYear)-1", and other

variations on the theme. None work. I have searched through the documentation, and can't find anything on the correct syntax.

Could anyone help?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

     $(=$(vMaxYear)-1)

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

     $(=$(vMaxYear)-1)

Not applicable
Author

Perfect. Thanks so much!