<?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 Add only consecutive month's data using flag in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424002#M800953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a flag as 1 for only consecutive months from the last month, else 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/185640_Screenshot_1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For MeterID = 1, output = 3,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For MeterID = 2, output = 2 and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For MeterID = 3, output = 3&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;Help me to achieve this in script. Also attached the sample data and QVW file.&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;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Siva.&lt;BR /&gt;&lt;/SPAN&gt;&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>Add only consecutive month's data using flag</title>
      <link>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424002#M800953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to create a flag as 1 for only consecutive months from the last month, else 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/185640_Screenshot_1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;For MeterID = 1, output = 3,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For MeterID = 2, output = 2 and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For MeterID = 3, output = 3&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;Help me to achieve this in script. Also attached the sample data and QVW file.&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;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Siva.&lt;BR /&gt;&lt;/SPAN&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/Add-only-consecutive-month-s-data-using-flag/m-p/1424002#M800953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add only consecutive month's data using flag</title>
      <link>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424003#M800954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is output = 3 and 2?&lt;/P&gt;&lt;P&gt;Never mind, got it....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 20:14:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424003#M800954</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2017-12-04T20:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add only consecutive month's data using flag</title>
      <link>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424004#M800955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For meter ID =1, there are 3 consecutive months from the last month Dec, Nov and Oct&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For meter ID =2, there are 2 consecutive months from the last month Nov and Oct and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For meter ID =3, there are 3 consecutive months from the last month Aug, Sep and Oct.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2017 20:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424004#M800955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-04T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add only consecutive month's data using flag</title>
      <link>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424005#M800956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one solution might be;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_283924_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/185679_QlikCommunity_Thread_283924_Pic2.JPG" style="height: 307px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1512438003605203 jive_text_macro" jivemacro_uid="_1512438003605203"&gt;
&lt;P&gt;table1:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(BillMonth=AddMonths(Previous(BillMonth),1) and MeterID=Previous(MeterID), Peek(ConsecMonth)+1,1) as ConsecMonth&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-objectid="306414" data-objecttype="13" href="https://community.qlik.com/servlet/JiveServlet/download/2003-283924-1394617-306414/sample1.xlsx"&gt;https://community.qlik.com/servlet/JiveServlet/download/1394617-306414/sample1.xlsx&lt;/A&gt;&lt;SPAN&gt;] (ooxml, embedded labels, table is Sheet1);&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 01:40:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-only-consecutive-month-s-data-using-flag/m-p/1424005#M800956</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-12-05T01:40:42Z</dc:date>
    </item>
  </channel>
</rss>

