<?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 Counting months between startdate and EndDate in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75350#M788011</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a Qlik-report and I have a problem that I cannot solve. I have tried many different scripts "counting months between two dates". But those scripts aren't exact what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a script that can pickup the different of the dates 01, 15 and 16 for both StartDates and EndDates. The example below shows how the months are counting. The script should apply for the whole calendar from January to December&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 248px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="80"&gt;StartDate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="80"&gt;EndDate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="88"&gt;Count month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;01.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;01.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;15.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;15.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;16.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;16.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any helps. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Counting months between startdate and EndDate</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75350#M788011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a Qlik-report and I have a problem that I cannot solve. I have tried many different scripts "counting months between two dates". But those scripts aren't exact what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a script that can pickup the different of the dates 01, 15 and 16 for both StartDates and EndDates. The example below shows how the months are counting. The script should apply for the whole calendar from January to December&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 248px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="80"&gt;StartDate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="80"&gt;EndDate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="88"&gt;Count month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;01.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;01.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;15.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;15.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;16.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;15.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="20" style="border-top: none;"&gt;16.01.2018&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;16.06.2018&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any helps. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75350#M788011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting months between startdate and EndDate</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75351#M788012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(Month(EndDate) + fabs(Day(EndDate)&amp;gt;15)) &lt;/P&gt;&lt;P&gt;- (Month(StartDate)+ fabs(Day(StartDate)&amp;gt;15))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to cross years, it just needs a small tweak to consider the year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 19:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75351#M788012</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2018-02-22T19:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Counting months between startdate and EndDate</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75352#M788013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SET DateFormat='DD.MM.YYYY';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(day(StartDate) &amp;lt;= 15, MonthStart(StartDate), MonthStart(AddMonths(StartDate,1))) as ds,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(day(EndDate) &amp;lt;= 15, MonthStart(EndDate), MonthStart(AddMonths(EndDate,1))) as de, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Count month]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2003" data-containertype="14" data-objectid="292502" data-objecttype="1" href="https://community.qlik.com/thread/292502"&gt;https://community.qlik.com/thread/292502&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;the expression in the chart is&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Num(((year(de) * 12) + month(de)) - (((year(ds) * 12) + month(ds))) + 1) -1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/194269_1.png" style="height: auto; width: auto;" /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 19:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75352#M788013</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2018-02-22T19:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Counting months between startdate and EndDate</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75353#M788014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;The script works perfect&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 20:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75353#M788014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T20:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Counting months between startdate and EndDate</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75354#M788015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script of Rob Wunderlich is easier and shorter to use in my script.&lt;/P&gt;&lt;P&gt;Thank you for the solution. I will try your script in my report&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Feb 2018 20:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-months-between-startdate-and-EndDate/m-p/75354#M788015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-22T20:53:09Z</dc:date>
    </item>
  </channel>
</rss>

