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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max sales date from March

Hi,

I'm desperately trying to catch last sales date from two months back. Since it's May now, I shoud find last date from March. This is how I tried to do that:

sum(Month(AddMonths(Date(Today()),-2)), 'M/D/YYYY'), {<[Snapshot Date] = date(max({1}[Snapshot Date])},Year = {$(=only(Year))} )

2 Replies
maxgro
MVP
MVP

not sure to understand as you have 3 field, year, month and snapshot date and I don't know the meaning;

if d is the date field, m the month field and y the year field

the max date of two months ago maybe

=max ({$<m={"$(=month(addmonths(Today(),-2)))"},y={"$(=year(addmonths(Today(),-2)))"}>} d)

johnca
Specialist
Specialist

If I'm reading this right to get the last day of a month 2 months ago use...

Date(MonthEnd(Max(date),-2))

...with date being your date field. Just change the number to the number of months ago desired.