Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year over Year & Month over Month Analysis

Hi all,

I am trying to get a year over year analysis to work both by year and month selections.

When I select a year say 2014 and a specific month say 01, it works perfectly across both tabs (current and previous). The problem comes when I select multiple months, on the selected year tab, it's fine but on the previous year tab all the months are selected although the total is correct only for the selected months.

I have spent days to make it work but no luck. I hope someone could help if they had encounter this before.

Please feel free to ask for more clarification. Thank you. Jay

11 Replies
salto
Specialist II
Specialist II

Hello Jeremaine,

I have two expressions. One for this year and other pfor the previous.

I am using Year (year of a date) and DateID in the calendar.

Sales 2014 (Max(Year):

=sum({$<Year={$(=Max(Year))}>} SalesAmount)))

Sales 2013 (which is the max(Year)-1);

=sum({<Year={$(=max(Year)-1)},DateID={"<=$(=date(addmonths(CurrentDay,-(NextYear-Max(Year))*12)))"}>} SalesAmount)))

Hope this helps!

Not applicable
Author

Hi Salto,

Thanks for this, I forgot to mention, I have 12 months as expressions.

I have a list of year from the date dimension, does this works when you select any year?

Regards,

Jeremaine

salto
Specialist II
Specialist II

Hi Jeremaine,

yes it works, at least in my case. I select 1013 and shows sales for 2013 and 2012 (selected months)

Hth

Not applicable
Author

Thank you Salto,

It didn't work for me, can you please send me a demo file.

Thanks.


salto
Specialist II
Specialist II

Hello,

I have deleted some code, but please do check the (now corrected) expressions in the chart, and the relationship between them and the Year selected.

Hth.

Not applicable
Author

There isn't any attachment SALTO, please check.

salto
Specialist II
Specialist II

Weird, I can see it... anyway I am attaching it again.

Please let me know.

Not applicable
Author

Thank you, now I can see it. Will try it now and let you know how I get on.

salto
Specialist II
Specialist II

Hello,

did you have any luck on this?