Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Malini
Contributor
Contributor

Get the month of December of the previous year

Being new to Qliksense, I need a little help.

I would like to analyze data month by month with the following formula:

=(sum(SUBL) / above(sum(SUBL))) -1

I have to get each time the previous month with the 'above'. When I use a Year-Month dimension (=Date(MonthStart(Date_link), 'MMM-YYYY') everything works correctly. However, I want to have a dimension per month (=Month(Date_link)). So I created three bar chart for each year I want to analyze.

For the current year:

=(sum({$<Year_first={$(=Year(Today()))}, Month_link =>}SUBL) / above(sum({$<Year_first={$(=Year(Today()))}, Month_link =>}SUBL))) -1

the previous year:

=(sum({$<Year_first={$(=Year(Today())-1)}, Month_link =>}SUBL) / above(sum({$<Year_first={$(=Year(Today())-1)}, Month_link =>}SUBL))) -1

two years before:

=(sum({$<Year_first={$(=Year(Today())-2)}, Month_link =>}SUBL) / above(sum({$<Year_first={$(=Year(Today())-2)}, Month_link =>}SUBL))) -1

(The Month_link has been added so that the graph does not react to any month selections of the filter pane month.)

It leaves me with histograms that display no value for January, I believe that Qlik does not manage to get the previous year.

How do I do this?

Malini_0-1653489986312.png

 

 Could someone help me ? 

 

Labels (6)
1 Reply
Rocky6
Creator
Creator

Hi All,

I am working on some numbers and i need to calculate the following in the dashboard

(Count of items for dec21)- (count of items for nov 22) / (count of items for dec 21).

Can anyone help me out for  a set to calculate the above req. 

Thanks in advance