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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Yearly Value by Historic Years Automatically

Hi Guys,

I calculate a value for spend by customers and compare against historic figures.

I have a set expression for each year at the moment

sum({<Year={'2012'}>}[Invoice Value])

sum({<Year={'2011'}>}[Invoice Value])

sum({<Year={'2010'}>}[Invoice Value])

etc

i would like to fix this in permanently rather than adding one each year going forward, for example using Year=(vToday)-1 , -2, -3, -4 etc for the past 5 years for example.

Any ideas how to achieve this?

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sure, you can use:

sum({$<Year={$(=Year(Today())-X)}>} [Invoice Value])

Where X represents how many years you want to subtract from today.

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Sure, you can use:

sum({$<Year={$(=Year(Today())-X)}>} [Invoice Value])

Where X represents how many years you want to subtract from today.