Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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?

1 Solution

Accepted Solutions
jsn
Honored Contributor

Re: Yearly Value by Historic Years Automatically

Sure, you can use:

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

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

1 Reply
jsn
Honored Contributor

Re: Yearly Value by Historic Years Automatically

Sure, you can use:

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

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

Community Browser