Discussion Board for collaboration related to QlikView App Development.
Hi everyone!
I'm new at Qlik. I was wondering how to obtain the difference in months between two dates that are in different formats. For example:
Date 1: 13/06/2020 (DD/MM/YYYY)
Date 2: 2020/05 (YYYY/MM)
For the example above, I should obtain 1 month.
Note: Both fields are in date format so no conversion is needed.
Any idea?
month(date(date#('13/06/2020','DD/MM/YYYY'),'MM/YYYY'))-month(date(date#('2020/05','YYYY/MM'),'MM/YYYY'))
else u can try below link method
Solved: Count number of months between two dates - Qlik Community - 1540620
12*(Year(Date1)-Year(Date2))+Month(Date1)-Month(Date2)
@ToysRUSCreditCard wrote:
Hi everyone!
I'm new at Qlik. I was wondering how to obtain the difference in months between two dates that are in different formats. For example:
Date 1: 13/06/2020 (DD/MM/YYYY)
Date 2: 2020/05 (YYYY/MM)
For the example above, I should obtain 1 month.
Note: Both fields are in date format so no conversion is needed.
Any idea?
Try: Month(Date#(End_date,'DD-MM-YYYY'))-Month(Date#(Start_date,'DD-MM-YYYY'))
((year(Date#('31-02-2019','DD-MM-YYYY'))*12)+month(Date#('31-02-2019','DD-MM-YYYY'))) - (((year(Date#('01-01-2018','DD-MM-YYYY'))*12)+month(Date#('01-01-2018','DD-MM-YYYY'))))