Skip to main content
Announcements
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
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.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

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

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

=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)