Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Question: Current and Previous year comparisons


I have a dashboard that shows sales comparison between Current Year(selected in listbox) and Previous Year.

I calculate the previous year Sales in the charts using the logic:  sum({<[Year]={"$(=Max([Year])-1)"}>}[Sales])

The issue is that since there is no data for say April onwards for 2021, the charts show blank when April-Dec is selected in month listbox though it should show data for 2020. The months that don't have data for 2021 are greyed out in the Month listbox.


Attaching a screenshot to explain the issue.





Labels (2)
2 Replies
Specialist II
Specialist II

Hi @AB108 , first all, you must remember that if there is not month April in 2021, and you clic on April, it is going to automaticaly to break the year selection, and pick the year that has values in April.

So, you can do a few test :

1.- please check wht happens modifying this :



2.- please check wht happens modifying this :



3.- Test  with theses  expressions :

exp1: sum({<[Year]={"$(=Max([Year]))"}>}[Sales])

exp2 : sum({<[Year]={"$(=Max([Year])-1)"}>}[Sales])


Contributor II
Contributor II

Hi @QFabian , Thanks for your reply.

The first two options dint work. The expression you added is exactly what I am using.

Any other way to get this to work.