Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
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 II
Partner - Master II

Hello, try this;

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