<?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: count per month between dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334391#M492317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cool! it works! It generates a lot of data, but it works.&lt;/P&gt;&lt;P&gt;many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jul 2012 15:27:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-07-04T15:27:41Z</dc:date>
    <item>
      <title>count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334385#M492311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have contracts with a startDate and endDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id&amp;nbsp; |&amp;nbsp; startDate&amp;nbsp;&amp;nbsp;&amp;nbsp; | endDate&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; | 01.01.2011&amp;nbsp; | 31.12.2011&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp; | 01.05.2011&amp;nbsp; | 31.12.2011&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp; | 01.01.2011&amp;nbsp; | 31.12.2012&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp; | 01.05.2011&amp;nbsp; | 31.12.2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need to count the active contracts per month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result Diagram:&lt;/P&gt;&lt;P&gt;01/2011 : 2&lt;/P&gt;&lt;P&gt;02/2011 : 2&lt;/P&gt;&lt;P&gt;03/2011 : 2&lt;/P&gt;&lt;P&gt;04/2011 : 2&lt;/P&gt;&lt;P&gt;05/2011 : 4&lt;/P&gt;&lt;P&gt;06/2011 : 5&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:03:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334385#M492311</guid>
      <dc:creator />
      <dc:date>2012-07-04T13:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334386#M492312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are your startDate always at month's start and endDate always on month's end?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could create a Table with Month start dates, then use an INTERVALMATCH to link your Month date table to the ID periods. Please check INTERVALMATCH LOAD prefix in the Help file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334386#M492312</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-04T13:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334387#M492313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sadly the start and end dates can be any date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334387#M492313</guid>
      <dc:creator />
      <dc:date>2012-07-04T13:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334388#M492314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So does a contract count to July if the contract ends somewhere in the middle? Are there any additional rules?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My suggested approach should work if you are saying 'Nr of contracts at a certain date', then create the table of e.g. Month start dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334388#M492314</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-04T13:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334389#M492315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;swuehl wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So does a contract count to July if the contract ends somewhere in the middle? Are there any additional rules?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My suggested approach should work if you are saying 'Nr of contracts at a certain date', then create the table of e.g. Month start dates.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;yes, a contract counts to July if it ends somewhere in the middle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did look at the INTERVALMATCH and it looks promising. But I actually have 2 date ranges (start/end of contract and start/end of month) and the INTERVALMATCH only checks if a single value is within a range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or maybe I don't get it... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:45:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334389#M492315</guid>
      <dc:creator />
      <dc:date>2012-07-04T13:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334390#M492316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still believe an Intervalmatch should work, but maybe there is an easier solution for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TEST:&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;addmonths(monthstart(startDate),iterno()-1) as ContractMonth &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;while monthstart(endDate) &amp;gt;= addmonths(monthstart(startDate),iterno()-1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Id&amp;nbsp; ,&amp;nbsp; startDate&amp;nbsp;&amp;nbsp;&amp;nbsp; , endDate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1&amp;nbsp;&amp;nbsp; , 01.01.2011&amp;nbsp; , 31.12.2011&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2&amp;nbsp;&amp;nbsp; , 01.05.2011&amp;nbsp; , 31.12.2011&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3&amp;nbsp;&amp;nbsp; , 01.01.2011&amp;nbsp; , 31.12.2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4&amp;nbsp;&amp;nbsp; , 01.05.2011&amp;nbsp; , 31.12.2012&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;5&amp;nbsp;&amp;nbsp; , 20.02.2011 , 1.12.2011&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then create a table with &lt;EM&gt;ContractMonth &lt;/EM&gt;as dimension (or &lt;EM&gt;=MonthName(ContractMonth)&lt;/EM&gt;, if you like), and then use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=count(Id) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 13:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334390#M492316</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-07-04T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: count per month between dates</title>
      <link>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334391#M492317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cool! it works! It generates a lot of data, but it works.&lt;/P&gt;&lt;P&gt;many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 15:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-per-month-between-dates/m-p/334391#M492317</guid>
      <dc:creator />
      <dc:date>2012-07-04T15:27:41Z</dc:date>
    </item>
  </channel>
</rss>

