Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Include the current year in Expression

Good day

I have the following expression:

Sum ({<Year = {'2017'}>} Cant_Vend)

What I need is to change the 2017 for a function that takes me the Current Year for a chart and on a following chart subtract one year and show me the year before.

años.JPG

I know I can use the lists as a filter, but that's how they request it.

Thanks for the reply.

2 Replies
sunny_talwar

May be this

Current Year

Sum({<Year = {$(=Year(Today()))}>} Cant_Vend)

Previous Year

Sum({<Year = {$(=Year(Today())-1)}>} Cant_Vend)

andre_mueller
Partner - Contributor II
Partner - Contributor II

Hi Juan,

for the current year you can use:

Sum ({<Year = {$(=Year(Today()))}>} Cant_Vend)

for the year before:

Sum ({<Year = {$(=Year(Today())-1)}>} Cant_Vend)

then:

Sum ({<Year = {$(=Year(Today())-2)}>} Cant_Vend)

and so on..

If you need a dynamic number of Charts (maybe different number of years), the "Trelllis..." option in the Dimension properties tab is maybe worthy to have a look for you.

Regards

André