Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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)