Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
souadouert
Specialist
Specialist

diff in month betweeen two dates

I have two date 20180130 - 20180228  and i need to calculate the number of months between two date  in straight table (CHART)
so in my example i have to find  1 MONTH

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

(Year(Date#(20180228,'YYYYMMDD'))*12+Month(Date#(20180228,'YYYYMMDD')))

-

(Year(Date#(20180130,'YYYYMMDD'))*12+Month(Date#(20180130,'YYYYMMDD')))

View solution in original post

3 Replies
tresesco
MVP
MVP

First convert the dates using date# with proper format like: Date#( Date1, 'YYYYMMDD') and then follow one method like shown here:

How Do I Get the Number of Months Between Two Dates?

Calculating Months difference between two dates

sasiparupudi1
Master III
Master III

Interval(Date#('20180228','YYYYMMDD')-Date#('20180130','YYYYMMDD'),'d')

sasiparupudi1
Master III
Master III

(Year(Date#(20180228,'YYYYMMDD'))*12+Month(Date#(20180228,'YYYYMMDD')))

-

(Year(Date#(20180130,'YYYYMMDD'))*12+Month(Date#(20180130,'YYYYMMDD')))