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

clarification on sale value of last year same month formula

Anyone clarify on this issue

while choosing current month (August - 2016), i need to get sale value of last year same month (August - 2015) in qlik sense.

i have columns and format like below

Sales_Invoice_Date  - datetime  - 2016-08-12 00:00:00.000

Month_id    - int - 201608

MonthYear    - nvarchar(100) - (August - 2016)

it is KPI and have used formula like below in load editor, while searching for MonthYear in associate search

im not getting any value. please help

Sum

( {<Year=,

Month =,

Month_id = {"$(=(date#(date(MonthName(AddMonths((max(Sales_Invoice_Date)), -12)),'YYYYMM'))))"}

>} Revenue)

2 Replies
sunny_talwar

May be change Month_id in the script:

LOAD Date(MonthStart(Sales_Invoice_Date), 'YYYYMM') as Month_id

and this:

Sum({<Year, Month, Month_id = {"$(=Date(AddYears(Max(Month_id), -1), 'YYYYMM'))"}>} Revenue)

lakshmikandh
Specialist II
Specialist II

If you are looking for a month in Associative search and select that, it will filter the records for that month so the previous period data also will get filtered out in that case. May be that's why your KPI showing as blank.