Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

aurelie_potvin
New 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
MVP
MVP

Re: Get Sales vs Last Month Sales for each month

Perhaps

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

3 Replies
Highlighted
vkish16161
Contributor III

Re: Get Sales vs Last Month Sales for each month

‌Maybe ,

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

MVP
MVP

Re: Get Sales vs Last Month Sales for each month

Perhaps

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

aurelie_potvin
New Contributor II

Re: Get Sales vs Last Month Sales for each month

Thanks Jonathan & Vishnu! 

It worked :-)

Community Browser