<?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 counting in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Consecutive-counting/m-p/1400657#M816033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load *,If(Values &amp;lt; 0 and Previous(Values) &amp;gt;0,1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Values &amp;lt; 0 and Previous(Values) &amp;lt; 0 ,Peek(Cumm) + 1,0)) as Cumm;&lt;/P&gt;&lt;P&gt;Load * inline [&lt;/P&gt;&lt;P&gt;Date,Values&lt;/P&gt;&lt;P&gt;07/01/2017,10&lt;/P&gt;&lt;P&gt;08/01/2017,20&lt;/P&gt;&lt;P&gt;09/01/2017,-10&lt;/P&gt;&lt;P&gt;10/01/2017,30&lt;/P&gt;&lt;P&gt;11/01/2017,-40&lt;/P&gt;&lt;P&gt;12/01/2017,-50&lt;/P&gt;&lt;P&gt;13/01/2017,20&lt;/P&gt;&lt;P&gt;14/01/2017,30&lt;/P&gt;&lt;P&gt;15/01/2017,-10&lt;/P&gt;&lt;P&gt;16/01/2017,-40&lt;/P&gt;&lt;P&gt;17/01/2017,40&lt;/P&gt;&lt;P&gt;18/01/2017,-10&lt;/P&gt;&lt;P&gt;19/01/2017,50&lt;/P&gt;&lt;P&gt;20/01/2017,60&lt;/P&gt;&lt;P&gt;21/01/2017,-20&lt;/P&gt;&lt;P&gt;22/01/2017,-10&lt;/P&gt;&lt;P&gt;23/01/2017,-30&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalData:&lt;/P&gt;&lt;P&gt;NoConcatenate Load * Resident Data where Cumm &amp;gt; 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Sep 2017 17:26:26 GMT</pubDate>
    <dc:creator>kaushiknsolanki</dc:creator>
    <dc:date>2017-09-12T17:26:26Z</dc:date>
    <item>
      <title>Consecutive counting</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-counting/m-p/1400656#M816032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fellow Qlikviewers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a straight table with different trade results where the dimension is the time stamp or the trade number.&lt;/P&gt;&lt;P&gt;Now I would like to calculate how many consecutive winners (sum(Profit)&amp;gt;0) or losses(sum(Profit)&amp;lt;0) that I have throughout my table. The table is sorted by the trade order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Later I would like to decide to only show all the trades in the table where we had maximum 2 consecutive losses, which would eliminate all the loosing trades from the table that would occur a potential third time (if I have chosen to display only maximum 2 consecutive losses).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have outlined in red color in the column "Consecutive Losses" to show you what I would like to see if I select in a variable to ONLY see maximum 2 consecutive losses in my entire table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary:&lt;/P&gt;&lt;P&gt;1. How do I calculate consecutive losses in my table?&lt;/P&gt;&lt;P&gt;2. How do I program a variable and the straigh table so it only show max amount of consecutive losses as I displayed in my attached picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried many things, but I can just not figure out how to display the exact amount of maximum consecutive losses that I would like to see. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Qlikview v12.&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/Consecutive-counting/m-p/1400656#M816032</guid>
      <dc:creator>wardzynski</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Consecutive counting</title>
      <link>https://community.qlik.com/t5/QlikView/Consecutive-counting/m-p/1400657#M816033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load *,If(Values &amp;lt; 0 and Previous(Values) &amp;gt;0,1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Values &amp;lt; 0 and Previous(Values) &amp;lt; 0 ,Peek(Cumm) + 1,0)) as Cumm;&lt;/P&gt;&lt;P&gt;Load * inline [&lt;/P&gt;&lt;P&gt;Date,Values&lt;/P&gt;&lt;P&gt;07/01/2017,10&lt;/P&gt;&lt;P&gt;08/01/2017,20&lt;/P&gt;&lt;P&gt;09/01/2017,-10&lt;/P&gt;&lt;P&gt;10/01/2017,30&lt;/P&gt;&lt;P&gt;11/01/2017,-40&lt;/P&gt;&lt;P&gt;12/01/2017,-50&lt;/P&gt;&lt;P&gt;13/01/2017,20&lt;/P&gt;&lt;P&gt;14/01/2017,30&lt;/P&gt;&lt;P&gt;15/01/2017,-10&lt;/P&gt;&lt;P&gt;16/01/2017,-40&lt;/P&gt;&lt;P&gt;17/01/2017,40&lt;/P&gt;&lt;P&gt;18/01/2017,-10&lt;/P&gt;&lt;P&gt;19/01/2017,50&lt;/P&gt;&lt;P&gt;20/01/2017,60&lt;/P&gt;&lt;P&gt;21/01/2017,-20&lt;/P&gt;&lt;P&gt;22/01/2017,-10&lt;/P&gt;&lt;P&gt;23/01/2017,-30&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalData:&lt;/P&gt;&lt;P&gt;NoConcatenate Load * Resident Data where Cumm &amp;gt; 2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 17:26:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Consecutive-counting/m-p/1400657#M816033</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2017-09-12T17:26:26Z</dc:date>
    </item>
  </channel>
</rss>

