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

Get Previous Months value

Hi everyone,

I try to create measure that display the avg of sales where field InsertDate equal to user selection minus one month (get the values of previous month)


avg({<InsertDate=,InsertMonth=,InsertYear=,Status={'Active'},InsertDate={">=$(=MonthStart(addMonths(max(InsertDate),-1)))).

<=$(=MonthEnd(addMonths(max(InsertDate),-1)))"}>}Sales)

Could you please advise?

Thank you!!

1 Reply
sunny_talwar

Remove InsertDate= from the beginning of your set analysis expression and see if that fixes the issue

Avg({<InsertMonth, InsertYear, Status = {'Active'}, InsertDate = {">=$(=MonthStart(AddMonths(Max(InsertDate), -1))))

<=$(=MonthEnd(AddMonths(Max(InsertDate), -1)))"}>} Sales)