I'm wanting to filter my dataset to look at last year (dynamically) in the expression field of my measure. When I use the following code, it errors out:
Sum({<Ship_Year = {Year(now())-1}>}PostageAMT_SumBy)
But if I were to separately use these two concepts:
Sum({<Ship_Year = {'2023'}>}PostageAMT_SumBy)
year(now())-1
These both work just as expected, with the first giving me my data for just 2023 and the next one displaying 2023 by itself, but clearly combining these two concepts is not something Qlik likes.
It seems that creating a variable was a viable solution.
The code in my expression:
Sum({<Ship_Year = {"$(v_Year)"}>}PostageAMT_SumBy)The variable definition:
=year(now())-1