<?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: Excluding Rows Based on Accumulator in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726928#M64002</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, Can you please explain me, how your code works? Sorry I tried understand and I am not. But the code looks good.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 17:21:26 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2020-07-10T17:21:26Z</dc:date>
    <item>
      <title>Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726631#M63996</link>
      <description>&lt;P&gt;Salutations Qlik Meisters,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do this in the load script?&lt;/P&gt;&lt;P&gt;In the "fact table" below, I want to remove row 2 through 6 because it had 0s in a row for more than 4 days.&lt;/P&gt;&lt;P&gt;We want to keep rows 9 through 11 because it only had 0s in a row for 3 days.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sazabi_0-1594323165820.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37249i12146DF286A2F2DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sazabi_0-1594323165820.png" alt="Sazabi_0-1594323165820.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:32:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726631#M63996</guid>
      <dc:creator>Sazabi</dc:creator>
      <dc:date>2021-04-02T08:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726672#M63997</link>
      <description>&lt;P&gt;One solution is.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD *, If(K1=Peek(K1),RangeSum(Peek(K2),1),1) As K2;
LOAD *, If(KPI_1=0 And Peek(KPI_1)=0,Peek(K1),RangeSum(Peek(K1),1)) As K1;
LOAD RecNo() As RowID,* INLINE [
    TIME, OBJECT, KPI_1, KPI_2
    1/1/2020, A, 0, 1
    1/2/2020, A, 0, 2
    1/3/2020, A, 0, 3
    1/4/2020, A, 0, 4
    1/5/2020, A, 0, 5
    1/6/2020, A, 1, 0
    1/7/2020, A, 1, 0
    1/8/2020, A, 0, 1
    1/9/2020, A, 0, 2
    1/10/2020, A, 0, 3
    1/11/2020, A, 1, 0
];

Left Join (tab1)
LOAD K1, If(Max(K2)&amp;gt;3,'N','Y') As Flag
Resident tab1
Group By K1
;

tab2:
LOAD RowID, TIME, OBJECT, KPI_1, KPI_2
Resident tab1
Where Flag='Y';

Drop Table tab1;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 00:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726672#M63997</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-10T00:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726674#M63998</link>
      <description>&lt;P&gt;Output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV36.PNG" style="width: 219px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37260iD3A9E3EAFF93F3E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV36.PNG" alt="commQV36.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 00:23:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726674#M63998</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-10T00:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726735#M63999</link>
      <description>&lt;P&gt;another approach&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Data:
Load *, div(KPI_2,5) as Div  
Inline [
    TIME, OBJECT, KPI_1, KPI_2
    1/1/2020, A, 0, 1
    1/2/2020, A, 0, 2
    1/3/2020, A, 0, 3
    1/4/2020, A, 0, 4
    1/5/2020, A, 0, 5
    1/6/2020, A, 1, 0
    1/7/2020, A, 1, 0
    1/8/2020, A, 0, 1
    1/9/2020, A, 0, 2
    1/10/2020, A, 0, 3
    1/11/2020, A, 1, 0];

Left Join(Data)
Load Distinct
date(TIME - IterNo()+1) as TIME,
1 as Flag
Resident Data
while Div=1 and IterNo()-1&amp;lt;KPI_2;

Final:
NoConcatenate
Load *
Resident Data
where Flag&amp;lt;&amp;gt;1;

Drop Table Data;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:18:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726735#M63999</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-10T09:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726918#M64000</link>
      <description>&lt;P&gt;A very delectable solution indeed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you Saran7de!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:29:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726918#M64000</guid>
      <dc:creator>Sazabi</dc:creator>
      <dc:date>2020-07-10T16:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726920#M64001</link>
      <description>&lt;P&gt;A very clever approach!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":cowboy_hat_face:"&gt;🤠&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726920#M64001</guid>
      <dc:creator>Sazabi</dc:creator>
      <dc:date>2020-07-10T16:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726928#M64002</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, Can you please explain me, how your code works? Sorry I tried understand and I am not. But the code looks good.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 17:21:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726928#M64002</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-10T17:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726959#M64003</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/894"&gt;@Saravanan_Desingh&lt;/a&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Yeah Sure. Let me try.&lt;/P&gt;&lt;P&gt;In first load I am creating flag using Div function. Which basically gives divisor of 5 for KPI_2. Meaning wherever value greater than 4 it will return 1 value.&lt;/P&gt;&lt;P&gt;In next load then I am taking all the Dates where divisor is 1 with KPI_2 values. Then using loop I am generating all previous dates till the KPI_2 values. For eg. In this case, for Date 1/5/2020 and KPI_2 value =5 it will gereate 1/5/2020 - 5 i.e 1/1/2020 to 1/5/2020.&amp;nbsp; So in loop it will generate all the Dates which actually we need to be remove as per the logic. Which we join back to main table with Flag.&lt;/P&gt;&lt;P&gt;I hope I explained well.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726959#M64003</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-07-10T19:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding Rows Based on Accumulator</title>
      <link>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726967#M64004</link>
      <description>&lt;P&gt;I understand now. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 19:47:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Excluding-Rows-Based-on-Accumulator/m-p/1726967#M64004</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-10T19:47:54Z</dc:date>
    </item>
  </channel>
</rss>

