Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get months from between two dates

Hi All,

i have one requirement, in that i need to calculate the difference between two dates.

For example, start date is 01/01/2011 and end date is 01/31/2014 and i want difference as 37,

if start date is 03/20/2010 and end date is 06/04/2010 then the difference is 4

if start date is 06/07/2009 and end date is 10/03/2010  then the difference is 17

i tried using =Floor((Floor([End Date])-Floor([Start Date]))/30) but for some values i'm getting errors for example start date is 03/10/2003 ans end date is 12/31/2003 then the difference should be 10 but i'm getting 9 like that i'm getting some correct values and some incorrect values .

Could you please help me on this?

Thanks,

VV

1 Reply
MarcoWedel

Hi,

one solution could be:

=Month(enddate)-Month(startdate)+(Year(enddate)-Year(startdate))*12+1

QlikCommunity_Thread_138849_Pic1.JPG.jpg

hope this helps

regards

Marco