<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Difference between two dates in Year,Month and Days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388328#M488069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "correct answer" of this thread is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do the next:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(day([End Date])&amp;gt;=day([Start Date]),&lt;/P&gt;&lt;P&gt;div(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))),12) &amp;amp; ' Years'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;mod(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))),12) &amp;amp; ' Months'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;([End Date]-AddMonths([Start Date],((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))))) &amp;amp; ' Days'&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;div(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1,12) &amp;amp; ' Years'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;mod(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1,12) &amp;amp; ' Months'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;([End Date]-AddMonths([Start Date],((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1)) &amp;amp; ' Days'&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jul 2017 17:56:03 GMT</pubDate>
    <dc:creator>eddysanchez</dc:creator>
    <dc:date>2017-07-27T17:56:03Z</dc:date>
    <item>
      <title>Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388319#M488060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried calculating difference between two dates example Qvw is attached it works for every date but only if the the end date's month is greater than the start. please see the image which is the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 17:29:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388319#M488060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-02T17:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388320#M488061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Irfan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think you need to use fab function when ever your geting - value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the Year field you need to use floor function to get the exact Year..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly find the attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope it will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Mukram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 17:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388320#M488061</guid>
      <dc:creator />
      <dc:date>2013-01-02T17:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388321#M488062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mukram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answer is some what correct but i am not getting the desired result if your for id 6 its not getting the right value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 17:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388321#M488062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-02T17:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388322#M488063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try these:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Months:&lt;/P&gt;&lt;P&gt;if(day([End Date])&amp;gt;=day([Start Date]),&lt;/P&gt;&lt;P&gt;num(month(MonthStart([End Date])-MonthStart([Start Date])))-1,&lt;/P&gt;&lt;P&gt;num(month(MonthStart([End Date])-MonthStart([Start Date])))-2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Days:&lt;/P&gt;&lt;P&gt;if(day([End Date])&amp;gt;=day([Start Date]),&lt;/P&gt;&lt;P&gt;day([End Date])-day([Start Date]),&lt;/P&gt;&lt;P&gt;[End Date]-MakeDate(year([End Date]),month([End Date])-1,day([Start Date])))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 18:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388322#M488063</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-01-02T18:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388323#M488064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG __jive_id="28365" class="jive-image-thumbnail jive-image" onclick="" alt="test2.jpg" src="https://community.qlik.com/legacyfs/online/28365_test2.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;As you can see above for id 6 and id 2 your month formula failes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 05:32:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388323#M488064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-03T05:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388324#M488065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry i meant for id 5 and 2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 06:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388324#M488065</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-07T06:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388325#M488066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;,1),'0 Years ',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Age&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &amp;amp; ' Years ')&lt;BR /&gt;&amp;amp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;),'0 Months ',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;fabs&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)) &amp;amp; ' Months ',&lt;BR /&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)+12)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;))-1&amp;nbsp; &amp;amp; ' Months '&lt;BR /&gt;))&lt;BR /&gt;&amp;amp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &amp;amp; ' Days',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &amp;amp; ' Days',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[End Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[Start Date]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)))-1 &amp;amp; ' Days'&lt;BR /&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 08:42:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388325#M488066</guid>
      <dc:creator />
      <dc:date>2013-01-07T08:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388326#M488067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone for this. I needed to do exactly that. I made myself an example to make all this work and I would like to share it with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complete fully working qvw and source code. Thanks to Haider Al-Seaidy&lt;/P&gt;&lt;P&gt;for his correct answer. It's exactly what I needed. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric Tremblay in Montreal, Canada&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Sample data&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data_test:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;date1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt;date1&lt;BR /&gt;2011-01-15, &lt;BR /&gt;2011-02-18,&lt;BR /&gt;2008-01-15, &lt;BR /&gt;2010-02-18,&lt;BR /&gt;2007-01-15, &lt;BR /&gt;2009-02-18,&lt;BR /&gt;2012-01-15, &lt;BR /&gt;2014-02-18,&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;Temp: &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Data_test; &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vMinDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('MinDate'));&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LET&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vMaxDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('MaxDate'));&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// This section here will calculate&lt;BR /&gt;// the age between the smallest and the largest dates&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;min_max_order_dates:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// Original Code by Haider Al-Seaidy. Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddYears&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,1),'0 Years ',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Age&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;amp; ' Years ')&lt;BR /&gt;&amp;amp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),'0 Months ',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;fabs&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &amp;amp; ' Months ',&lt;BR /&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)+12)-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))-1 &amp;amp; ' Months '&lt;BR /&gt;))&lt;BR /&gt;&amp;amp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;amp; ' Days',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) - &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;amp; ' Days',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DAY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MinDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)))-1 &amp;amp; ' Days'&lt;BR /&gt;)) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AGE_BETWEEN_MinDate_MaxDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Temp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;// From this table&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Drop&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Temp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 15:58:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388326#M488067</guid>
      <dc:creator />
      <dc:date>2014-01-10T15:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388327#M488068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is probably the simplest way...&lt;/P&gt;&lt;P&gt;=((Date1- Date2) / 365) * 12&lt;/P&gt;&lt;P&gt;"=num(((vStartDate - vEndDate) / 365) * 12,'##')"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Given that you initially convert your Dates (For purposes of the Sum) into Number / integer format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lemme Know if it worked for you too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Nico Oberholzer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 20:51:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388327#M488068</guid>
      <dc:creator>nico_ilog</dc:creator>
      <dc:date>2014-10-13T20:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388328#M488069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "correct answer" of this thread is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do the next:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(day([End Date])&amp;gt;=day([Start Date]),&lt;/P&gt;&lt;P&gt;div(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))),12) &amp;amp; ' Years'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;mod(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))),12) &amp;amp; ' Months'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;([End Date]-AddMonths([Start Date],((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date]))))) &amp;amp; ' Days'&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;div(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1,12) &amp;amp; ' Years'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;mod(((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1,12) &amp;amp; ' Months'&lt;/P&gt;&lt;P&gt;&amp;amp;' '&amp;amp;&lt;/P&gt;&lt;P&gt;([End Date]-AddMonths([Start Date],((year([End Date])*12)+month([End Date])) - (((year([Start Date])*12)+month([Start Date])))-1)) &amp;amp; ' Days'&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 17:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/388328#M488069</guid>
      <dc:creator>eddysanchez</dc:creator>
      <dc:date>2017-07-27T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/1533527#M488070</link>
      <description>&lt;P&gt;I agree that the correct answer is incorrect. I noticed it because it gave me 0 years 0 months 0 days when it was exactly 1 year. I was looking at ways to correct it when I scrolled down and found yours!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Auzzie&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 20:08:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/1533527#M488070</guid>
      <dc:creator>auzzie4185</dc:creator>
      <dc:date>2019-01-22T20:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between two dates in Year,Month and Days</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/1687259#M488071</link>
      <description>&lt;P&gt;If you have the opportunity to calculate in the load script, a preceding load makes the script more manageable - and easier to correctly add 's' for multiple years/months/days etc.&lt;/P&gt;&lt;P&gt;This script will only show a value for years, months or days if there is one (e.g. if the duration is exactly 2 years and 1 day, it will output "2 years, 1 day" rather than "2 years, 0 months, 1 days")&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;0 years, 0 months, 11 days: "11 days"&lt;/LI&gt;&lt;LI&gt;0 years, 2 months, 1 day: "2 months, 1 day"&lt;/LI&gt;&lt;LI&gt;1 year, 3 months, 0 days: "1 year, 3 months"&lt;/LI&gt;&lt;LI&gt;0 years, 1 month, 0 days: "1 month"&lt;/LI&gt;&lt;LI&gt;1 year, 2 months, 3 days: "1 year, 2 months, 3 days"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD If([_y] = 0, '', [_y] &amp;amp; If([_y] = 1, ' year' , ' years' ) &amp;amp; If([_m] &amp;gt; 0 or [_d] &amp;gt; 0, ', ', ''))
&amp;amp; If([_m] = 0, '', [_m] &amp;amp; If([_m] = 1, ' month', ' months') &amp;amp; If([_d] &amp;gt; 0, ', ', ''))
&amp;amp; If([_d] = 0, '', [_d] &amp;amp; If([_d] = 1, ' day' , ' days' )) as [Duration];

LOAD If(Day([Support to]) &amp;gt;= Day([Support from]),
Div(((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))) , 12),
Div(((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))) - 1, 12)) as [_y]
, If(Day([Support to]) &amp;gt;= Day([Support from]),
Mod(((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))) , 12),
Mod(((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))) - 1, 12)) as [_m]
, If(Day([Support to]) &amp;gt;= Day([Support from]),
([Support to] - AddMonths([Support from], ((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))))),
([Support to] - AddMonths([Support from], ((Year([Support to]) * 12) + Month([Support to])) - (((Year([Support from]) * 12) + Month([Support from]))) - 1))) as [_d]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 10:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-two-dates-in-Year-Month-and-Days/m-p/1687259#M488071</guid>
      <dc:creator>SiO2y</dc:creator>
      <dc:date>2020-03-24T10:51:57Z</dc:date>
    </item>
  </channel>
</rss>

