Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
aravindkumarr
Contributor III
Contributor III

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
Partner
Partner

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

View solution in original post

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
aravindkumarr
Contributor III
Contributor III
Author

Hey Arjun,

Thank you so much. I got the output.