# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for
Did you mean:
Not applicable

## Date Difference between two field

Dear All,

I'm new in qlikview. Need your help to solve this issue. Please find my problem from below:

I have two date fields in String format. I will convert them into date formate "MM/YY". After convert into date formate then i will find out no of month between two fields.

Exp: Lot_month: 03/12 and to_moth_year: 03/15. Difference between two field will be 36 month. Please help me to write down the expression.

Regards,

Masba

1 Solution

Accepted Solutions
MVP

the difference of years *12 + the difference of months

= (right('03/15' ,2) - right('03/12',2))*12 +  (left('03/15' ,2) - left('03/12',2))

--> 36

4 Replies
Specialist II

MVP

the difference of years *12 + the difference of months

= (right('03/15' ,2) - right('03/12',2))*12 +  (left('03/15' ,2) - left('03/12',2))

--> 36

Not applicable
Author

= ((year(date#('3/23/2015')) - year(date#('1/1/2014'))) * 12)
+
(Month(date#('3/23/2015')) - Month(date#('1/1/2014')))

Thanks!

Not applicable
Author

Hi,

You can try this logic.

In script,

Date(Date#(StringDatefield,'MMM/YY'),'MM/YY') as First,

Date(Date#(StringDatefield,'MMM/YY'),'MM/YY') as Last

In text object can use below one.

= (Last-First)/(365/12)

Community Browser