Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help! How do I get previous (rolling) year when using sets?

Hi, I'm struggeling to see if this is possible. I have made a chart like:

error loading image

Here I have used a stacked chart and a set analysis to get the portion if sales depending when the customer was created like:

SUM({$<inv_head.Customer_create_date = {">=$(=min(addmonths(monthstart(inv_head.create_date),-5))) <$(=min(addmonths(monthstart(inv_head.create_date),-2))) "}>} inv_Line.net_dom_amount * [MA Currency Rate])

Now I would like to add a line showinh last years sales, but I can't get it to work using like.



SUM({$<inv_head.invoice_date = {">=$(=min(addmonths(monthstart(inv_head.invoice_date),-12))) <=$(=max(addmonths(monthend(inv_head.invoice_date),-12)))"}>} inv_Line.net_dom_amount * [MA Currency Rate])



Nwhat am I doing wrong? to get previous year must be one of the most common tasks out there.

To clearify: I would like to for each dimension(month) get the sales vale one year back.....

3 Replies
Not applicable
Author

Hi Mattias, Did you ever get this issue resolved? I am running into a similar issue. I have to find out the rolling 12 months back from a calendar driven date and also the prior rolling 12 months.

Not applicable
Author

No sorry, no reply yet

Not applicable
Author

Try Below:

SUM({$<inv_head.invoice_date = {">=$(=min(addmonths(monthstart(inv_head.invoice_date),-12))) <$(=max(addmonths(monthend(inv_head.invoice_date),-12)))"}>} inv_Line.net_dom_amount * [MA Currency Rate])