<?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 consecutive months. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86013#M753436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simplify in table like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(TOTAL &amp;lt;ID&amp;gt; YM)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Oct 2018 03:46:11 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2018-10-10T03:46:11Z</dc:date>
    <item>
      <title>Count consecutive months.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86011#M753434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across the discussion below and I have a very similar request but the data is slightly different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/286959" target="_blank"&gt;Consecutive count&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to count consecutive months per client. so my data would look like the left two columns and the result must be like the right hand column. I am extremely new to Qliksense and any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="215438" alt="examplexls.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215438_examplexls.png" style="height: auto;" /&gt;&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/Count-consecutive-months/m-p/86011#M753434</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count consecutive months.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86012#M753435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code should do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15391013240211844" jivemacro_uid="_15391013240211844"&gt;
&lt;P&gt;data:&lt;/P&gt;
&lt;P&gt;load *,&lt;/P&gt;
&lt;P&gt;Num(Date#(YM,'MMM-YY')) as [NUM YM];&lt;/P&gt;
&lt;P&gt;load * Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;ID,YM&lt;/P&gt;
&lt;P&gt;1,Jan-16&lt;/P&gt;
&lt;P&gt;1,Feb-16&lt;/P&gt;
&lt;P&gt;1,Mar-16&lt;/P&gt;
&lt;P&gt;1,Apr-16&lt;/P&gt;
&lt;P&gt;1,May-16&lt;/P&gt;
&lt;P&gt;2,Jan-16&lt;/P&gt;
&lt;P&gt;2,Feb-16&lt;/P&gt;
&lt;P&gt;2,Mar-16&lt;/P&gt;
&lt;P&gt;2,May-16&lt;/P&gt;
&lt;P&gt;3,Jan-16&lt;/P&gt;
&lt;P&gt;3,Feb-16&lt;/P&gt;
&lt;P&gt;3,Mar-16&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;OrderedData:&lt;/P&gt;
&lt;P&gt;load *,&lt;/P&gt;
&lt;P&gt;if&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;ID=peek(ID),&lt;/P&gt;
&lt;P&gt;peek([NUM YM]),&lt;/P&gt;
&lt;P&gt;// if&lt;/P&gt;
&lt;P&gt;// (&lt;/P&gt;
&lt;P&gt;// [NUM YM]=Num(AddMonths(peek([NUM YM]),1)),&lt;/P&gt;
&lt;P&gt;// 1,&lt;/P&gt;
&lt;P&gt;// 0&lt;/P&gt;
&lt;P&gt;// ),&lt;/P&gt;
&lt;P&gt;[NUM YM]&lt;/P&gt;
&lt;P&gt;) as [Flag],&lt;/P&gt;
&lt;P&gt;if&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;ID=peek(ID),&lt;/P&gt;
&lt;P&gt;if&lt;/P&gt;
&lt;P&gt;(&lt;/P&gt;
&lt;P&gt;[NUM YM]=Num(AddMonths(peek([NUM YM]),1)),&lt;/P&gt;
&lt;P&gt;1,&lt;/P&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;P&gt;),&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;) as [Flag2]&lt;/P&gt;
&lt;P&gt;Resident data&lt;/P&gt;
&lt;P&gt;order by ID,[NUM YM];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;drop table data;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives me the following,&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215511_sample.png" style="height: 496px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have on your spreadsheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 16:09:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86012#M753435</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2018-10-09T16:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count consecutive months.</title>
      <link>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86013#M753436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can simplify in table like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(TOTAL &amp;lt;ID&amp;gt; YM)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 03:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-consecutive-months/m-p/86013#M753436</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-10T03:46:11Z</dc:date>
    </item>
  </channel>
</rss>

