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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to substract month from date

Hi All,

I have a date field. I need to show records of last n months. So here I need to subtract given months from current date so that I'll get the date from where I need to display the records..

There is a function called AddMonths but I couldn't find such method for Substracting months. Can anybody plz guide me in subtracting given months from date?

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

If you give months in -ve then it will subtract, check below example

=AddMonths(Today(), 1)  -- 1/5/2014

=AddMonths(Today(), -1)  -- 11/5/2013

Hope this helps you.

Regards,

Jagan.

View solution in original post

2 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

If you give months in -ve then it will subtract, check below example

=AddMonths(Today(), 1)  -- 1/5/2014

=AddMonths(Today(), -1)  -- 11/5/2013

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Thanku