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: 
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')))