Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Fellow Qlik Sense Users,
I have created a Set Analysis expression to fix a chart to show the current year data which works perfectly OK.
Count({<YEAR={'2023'},RETURNED={[NO]}>}AREA),
However what I would like to do is to replace the fixed year '2023' with a variable.
The variable I have is:
=Year(Yearstart(Today()))
This produces the result 2023 which is correct.
I'd like to be able to incorporate the Variable into the Set Analysis, which I have tried, but the output is blank.
Can anyone please guide me in the right direction.
Many thanks,
David
Hi, @David_K
put your variable like vYear = $(=Year(Today()))
then in the analysis set just insert it next to the $
Count({<YEAR={"$(vYear)"},RETURNED={[NO]}>}AREA),
or better if your database your year field has the maximum year until 2023
I would make the variable like below, making it more dynamic
vYear = $(=Max(fieldYear))
Hi, @David_K
put your variable like vYear = $(=Year(Today()))
then in the analysis set just insert it next to the $
Count({<YEAR={"$(vYear)"},RETURNED={[NO]}>}AREA),
or better if your database your year field has the maximum year until 2023
I would make the variable like below, making it more dynamic
vYear = $(=Max(fieldYear))
Hi MatheusC,
many thanks for the feedback, your solution has worked perfectly.