Discussion board where members can get started with Qlik Sense.
If I have two dates 02/21/2017 & 01/26/2018, how could I get the number of months between these two dates?
Go to Solution.
I prefer to define a MonthSequence field in my master calendar.
Year(calDate) * 12 + Month(calDate) as MonthSequence,
In that case difference in months is simply the difference of the two month sequences.
If you want to do this in an expression, then you can do something similar
=(Year(date1) * 12 + Month(date1)) - (Year(date2) * 12 + Month(date2))
You can use below expression to get number of months between these two dates.
=Round((date#(01/26/2018) - date#(02/21/2017))/30,0)
PS - if you find this as correct/helpful, mark it as Correct/Helpful.