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: 
Anonymous
Not applicable

Year Field

I'm getting current year value from the script in a variable (vCYear). When I use this variable in Set Expression it works fine but when I try to do any subtractions like:

=sum({<FYear={$(vCYear-2)}>} Sales)

it does not work.

Labels (1)
1 Solution

Accepted Solutions
Clever_Anjos
Support
Support

=sum({<FYear={"$(=$(vCYear)-2)"}>} Sales)

View solution in original post

3 Replies
Clever_Anjos
Support
Support

=sum({<FYear={"$(=$(vCYear)-2)"}>} Sales)

v_iyyappan
Specialist
Specialist

Hi,

Try like this

=sum({<FYear={$(=vCYear)-2}>} Sales)  or =sum({<FYear={'$(=vCYear)-2'}>} Sales)

regards,

Anonymous
Not applicable
Author

Thank you both.

Both of the expressions that you guys mentioned worked:

=sum({<FYear={"$(=$(vCYear)-2)"}>} Sales)

and

=sum({<FYear={$(=vCYear)-2}>} Sales)