Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
dwighttrumbower
Creator
Creator

Summing prior year

I'm not the smartest when it comes to expressions.

I am trying to create a column that sums the prior year. If I hard code it, it will work. Year is the field that users can filter on.

Sum({$<Year={2022}>}Revenue)

I would like it work if the user selects a different year. The following doesn't work and I don't know if it can be done without using calendar variables.  Right now, creating calendar variables is not an option.

Sum({$<Year={$(=Max(Year))}>-1}Revenue)

Using this help page does help, but I get confused when trying to use fields in the expressions.
https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAnalys...

Thanks for any help.

Labels (3)
1 Reply
BrunPierre
Partner - Master
Partner - Master

Hello, try this;

Year={"$(=Max(Year)-1)"}