<?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: Months Between 2 Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Months-Between-2-Dates/m-p/612380#M1119577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OriginalTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;From DataSource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Function to calculate Months Difference in script&lt;/P&gt;&lt;P&gt;SET MonthDiff = Num(((year($2) * 12) + month($2)) - (((year($1) * 12) + month($1))) + 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; ACCT_ID&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; Month( AddMonths(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;START_DT&lt;/SPAN&gt; ,IterNo() - 1)) as Months&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident OriginalTable&lt;/P&gt;&lt;P&gt;While IterNo() &amp;lt;= ($(MonthDiff(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;START_DT&lt;/SPAN&gt;,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; END_DT&lt;/SPAN&gt;))) ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Feb 2014 19:00:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-02-05T19:00:17Z</dc:date>
    <item>
      <title>Months Between 2 Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Months-Between-2-Dates/m-p/612379#M1119576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Table.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/52659_Table.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(where START_DT and END_DT have the format: DD/MM/YYYY)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need is to find which months are between my 2 dates (START_DT and END_DT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, in the first row I have: START_DT = 19/11/2012 and END_DT = 17/01/2013&lt;/P&gt;&lt;P&gt;And the result should be:&lt;/P&gt;&lt;P&gt;Months: 11, 12, 01&lt;/P&gt;&lt;P&gt;That would be the months between those 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I get those values for each row?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 18:43:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Months-Between-2-Dates/m-p/612379#M1119576</guid>
      <dc:creator>microwin88x</dc:creator>
      <dc:date>2014-02-05T18:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Months Between 2 Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Months-Between-2-Dates/m-p/612380#M1119577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OriginalTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;From DataSource;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Function to calculate Months Difference in script&lt;/P&gt;&lt;P&gt;SET MonthDiff = Num(((year($2) * 12) + month($2)) - (((year($1) * 12) + month($1))) + 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; ACCT_ID&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; Month( AddMonths(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;START_DT&lt;/SPAN&gt; ,IterNo() - 1)) as Months&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident OriginalTable&lt;/P&gt;&lt;P&gt;While IterNo() &amp;lt;= ($(MonthDiff(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;START_DT&lt;/SPAN&gt;,&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; END_DT&lt;/SPAN&gt;))) ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2014 19:00:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Months-Between-2-Dates/m-p/612380#M1119577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-05T19:00:17Z</dc:date>
    </item>
  </channel>
</rss>

