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

Get Sales vs Last Month Sales for each month

Hi experts,

I have following information in my table

  • Region (with 3 regions A, B & C)
  • Month (ex. 31/07/17 formatted as Jul-17)
  • Sales $

In my report, I have a filter that lets me choose my month and now,I would like to show 6 KPI's which are the sales for each region, both for the chosen month as for the "chosen month -1".

I managed to set the 3 KPI's for the sales per region, per month but I cannot find a solution for the previous month.

  • Sales for Region A for chosen month : Avg({$<[Region]={"A"}>}[Sales])
  • Sales for Region A for chosen month -1 : ?

Any idea how I could do this?

Thanks in advance for your help & time

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps

=Avg({$<[Region] = {"A"}, Month = {"$(=Date(AddMonths(Month, -1), 'MMM-yy'))"}>} Sales)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
vkish16161
Creator III
Creator III

‌Maybe ,

Avg({$<[Region]={"A"}, month = {"=num(month-1)"} >}[Sales])

jonathandienst
Partner - Champion III
Partner - Champion III

Perhaps

=Avg({$<[Region] = {"A"}, Month = {"$(=Date(AddMonths(Month, -1), 'MMM-yy'))"}>} Sales)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
aurelie_potvin
Contributor II
Contributor II
Author

Thanks Jonathan & Vishnu! 

It worked 🙂