<?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: consecutive count in script. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462336#M436265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what the above will do for you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jan 2018 17:09:38 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-01-10T17:09:38Z</dc:date>
    <item>
      <title>consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462331#M436260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just I want to small help from you.I have a sample data based on sample data, I want to consecutive count.Provided the below screenshots for your reference.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/189606_Untitled.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;based on the Account number and start_date the consecutive count should be the (4).becous start_date month is not coming continuously for the &lt;SPAN style="font-size: 13.3333px;"&gt;Account number.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The below logic which is using to bring the consecutive count&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD Account_Number,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Year_Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End_date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; start_date&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Consecutive:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Account_Number,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(rowno()=1 or start_date = previous(start_date),1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(Billing_Year_Month-previous(Billing_Year_Month)=1, peek('Counter')+1,peek(_flag_Consec))) as _flag_Consec&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident 1 Order By Account_Number,Billing_Year_Month,start_date asc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also attached the sample data which is using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct the script and share your idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Irshad Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:41:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462331#M436260</guid>
      <dc:creator>iahmadmca1</dc:creator>
      <dc:date>2018-01-10T15:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462332#M436261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure I understand why the count should be 4? Can you elaborate a little?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462332#M436261</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-10T15:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462333#M436262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny for the quick response.&lt;/P&gt;&lt;P&gt;The count should be four because the start_date month is not coming continuously.&lt;/P&gt;&lt;P&gt;The &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Account_Number &lt;/STRONG&gt;is same for all five but the &lt;SPAN style="font-size: 13.3333px;"&gt;start_date month is not coming continuously.i have highlighted the below in screenshots.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/189617_Untitled.png" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Due to that, the consecutive count should be 4.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Irshad Ahmad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 16:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462333#M436262</guid>
      <dc:creator>iahmadmca1</dc:creator>
      <dc:date>2018-01-10T16:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462334#M436263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does this look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/189627_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD Account_Number, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Billing_Year_Month, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End_date, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; start_date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;[..\..\Downloads\Billing.txt]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;FinalTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; If(Account_Number = Previous(Account_Number) and (MonthStart(start_date) = MonthStart(Previous(start_date), 1) or MonthStart(start_date) = MonthStart(Previous(start_date), 0)), RangeSum(Peek('Consecutive'), 1), 1) as Consecutive&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Order By Account_Number, start_date;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Left Join (FinalTable)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD Account_Number,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; Max(Consecutive) as MaxConsecutive&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Resident FinalTable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Group By Account_Number;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 16:40:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462334#M436263</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-10T16:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462335#M436264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is sample data which I have shared, I have N number of &lt;/STRONG&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Account_Number and all &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Account_Number having the different consecutive count from there itself I need a count the consecutive count.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Please find the below-expected output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/189630_Untitled.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 17:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462335#M436264</guid>
      <dc:creator>iahmadmca1</dc:creator>
      <dc:date>2018-01-10T17:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462336#M436265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what the above will do for you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 17:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462336#M436265</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-01-10T17:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: consecutive count in script.</title>
      <link>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462337#M436266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sunny it's working perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 17:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/consecutive-count-in-script/m-p/1462337#M436266</guid>
      <dc:creator>iahmadmca1</dc:creator>
      <dc:date>2018-01-10T17:48:02Z</dc:date>
    </item>
  </channel>
</rss>

