Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

difference in months

Hi Folks,

i have a following case, i have 2 Fields: From Date and To Date,

case 1:

From_Date          To_Date

21.03.2015          25.03.2015

if i use this procedure :

Date(Date#(From_Date, 'DD.MM.YYYY'))as From_Date,

Date(Date#(To_Date, 'DD.MM.YYYY'))as To_Date,

Num(To_Date) - Num (From_Date), so i can calcualte the Difference in Days, and it does work great

Problem Case:

From_Date          To_Date

06.10.2017          06.05.2019 > How can i calculate in this case  the Difference in months

Thanks a lot for any feedback and help

Beck

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

Hi

i think you should look into this solution which is interesting too and try to replicate that in your app.

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

regards

Pradosh

Learning never stops.

View solution in original post

5 Replies
pradosh_thakur
Master II
Master II

Hi


date_diff  --->Num(To_Date) - Num (From_Date)


you can divide your date_diff/12 and ceil(date_diff/12),floor(date_diff/12) depending upon you want to include the current month or not.

regards

Pradosh

Learning never stops.
beck_bakytbek
Master
Master
Author

Hi Pradosh,

thanks a lot for your responce, but i dont understand this procedure, the funct: datediff i can normally use in excell but not in Qlik Sense

Thanks a lot

Beck

pradosh_thakur
Master II
Master II

Hi

i think you should look into this solution which is interesting too and try to replicate that in your app.

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

regards

Pradosh

Learning never stops.
beck_bakytbek
Master
Master
Author

Prodosh Mate, thanks a lot for your responce and helps, it does work

have a nice day

kindly

Beck

beck_bakytbek
Master
Master
Author

This Issue is solved, Solution can be found here: Difference in Month