Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Get previous month and the month behind previous month based on max(date)

Hi,

I need to get my previous month and the month behind previous month with respect to my max(date). This is required for me to show the last 3 month trends in my chart.

My max(Date)='01-08-2018'

Please provide a solution.

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi,

Check this.

Sum( {$<MonthYear={"$(=Date(AddMonths(Max(MonthYear),-1),'MMM-YY'))"}>} LineSalesAmount )

Read for more details: A Primer on Set Analysis

View solution in original post

4 Replies
ashwin_r
Contributor III
Contributor III

HI,

Use AddMonths() function ..

Regards,

Ashwin.

qlikviewwizard
Master II
Master II

Hi,

Check this.

Sum( {$<MonthYear={"$(=Date(AddMonths(Max(MonthYear),-1),'MMM-YY'))"}>} LineSalesAmount )

Read for more details: A Primer on Set Analysis

jyothish8807
Master II
Master II

Hi Aravind,

Try like this:

Sum( {$<Date={">=$(=Date(monthstart(AddMonths(Max(Date),-2)),'DD-MM-YYYY')) <=$(=Date(max(Date),'DD-MM-YYYY'))"}>} Sales )


Br,

KC

Best Regards,
KC
Anonymous
Not applicable
Author

Hey Arjun,

Thank you so much. I got the output.