<?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: Conditional counter on resident table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851337#M1215657</link>
    <description>&lt;P&gt;One more solution,&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;tab1:
Load *, AutoNumber(RowNo(),Area&amp;amp;Status) As Counter Inline [
ID, Project Name,Area,Status
100,Project A, A, backlog
101,Project B, A, backlog
106,Project C, A, backlog
110,Project D, A, inflight
111,Project E, B, complete
112,Project F, C, backlog
114,Project G, C, complete
];&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 25 Oct 2021 13:38:49 GMT</pubDate>
    <dc:creator>Saravanan_Desingh</dc:creator>
    <dc:date>2021-10-25T13:38:49Z</dc:date>
    <item>
      <title>Conditional counter on resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851205#M1215650</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have something that is a bit of a head scratcher. I have been close to an answer a couple of times but not getting the desired result.&lt;/P&gt;
&lt;P&gt;I have a data set loaded into my model - for this question I have simplified my data. I am taking a resident load using "order by" to put my data into the order I want it. my source looks as follows:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Project Name&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Area&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Status&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Project A&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;backlog&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;101&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Project B&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;backlog&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;106&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Project C&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;backlog&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;110&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Project D&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;inflight&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;111&lt;/TD&gt;
&lt;TD height="25px"&gt;Project E&lt;/TD&gt;
&lt;TD height="25px"&gt;B&lt;/TD&gt;
&lt;TD height="25px"&gt;complete&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;112&lt;/TD&gt;
&lt;TD height="25px"&gt;Project F&lt;/TD&gt;
&lt;TD height="25px"&gt;C&lt;/TD&gt;
&lt;TD height="25px"&gt;backlog&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="25px"&gt;114&lt;/TD&gt;
&lt;TD height="25px"&gt;Project G&lt;/TD&gt;
&lt;TD height="25px"&gt;C&lt;/TD&gt;
&lt;TD height="25px"&gt;complete&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what I want is a counter that works with the Area and status column i.e. if the AREA is the same as the previous area and the STATUS is the same as the previous status I want the counter to increment by 1... if the status is a new status or the area is a new area then the&amp;nbsp; counter resets to 1.&lt;/P&gt;
&lt;P&gt;so my output would be:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="590px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;ID&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project Name&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;Area&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;Status&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;Counter&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;100&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project A&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;backlog&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;101&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project B&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;backlog&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;106&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project C&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;backlog&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;110&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project D&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;A&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;inflight&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;111&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project E&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;B&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;complete&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px" height="25px"&gt;112&lt;/TD&gt;
&lt;TD width="147.234px" height="25px"&gt;Project F&lt;/TD&gt;
&lt;TD width="147.172px" height="25px"&gt;C&lt;/TD&gt;
&lt;TD width="73.7344px" height="25px"&gt;backlog&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="147.172px"&gt;114&lt;/TD&gt;
&lt;TD width="147.234px"&gt;Project G&lt;/TD&gt;
&lt;TD width="147.172px"&gt;C&lt;/TD&gt;
&lt;TD width="73.7344px"&gt;complete&lt;/TD&gt;
&lt;TD width="73.6875px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would be happy to combine area and status into a concatenated column if that would help with the calculation.&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851205#M1215650</guid>
      <dc:creator>chrismtb</dc:creator>
      <dc:date>2021-10-25T09:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional counter on resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851232#M1215654</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have tried with below sample data got the out put attached below. Please relate and check for your actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ID, Project Name,Area,Status&lt;BR /&gt;100,Project A, A, backlog&lt;BR /&gt;101,Project B, A, backlog&lt;BR /&gt;106,Project C, A, backlog&lt;BR /&gt;110,Project D, A, inflight&lt;BR /&gt;111,Project E, B, complete&lt;BR /&gt;112,Project F, C, backlog&lt;BR /&gt;114,Project G, C, complete&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;OrderedData:&lt;BR /&gt;Load * ,&lt;BR /&gt;'Temp' as Temp&lt;BR /&gt;Resident Data Order by Area,Status Asc;&lt;BR /&gt;Drop Table Data;&lt;/P&gt;
&lt;P&gt;Counter:&lt;BR /&gt;Load *,&lt;/P&gt;
&lt;P&gt;If(Area = Previous(Area) and Status = Previous(Status),RangeSum(1,Peek(Counter)),1) as Counter&lt;/P&gt;
&lt;P&gt;Resident OrderedData;&lt;BR /&gt;Drop Table OrderedData;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AshutoshBhumkar_0-1635156794459.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/65146i72D0321A1FA1E2D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AshutoshBhumkar_0-1635156794459.png" alt="AshutoshBhumkar_0-1635156794459.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ashutosh&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:13:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851232#M1215654</guid>
      <dc:creator>AshutoshBhumkar</dc:creator>
      <dc:date>2021-10-25T10:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional counter on resident table</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851337#M1215657</link>
      <description>&lt;P&gt;One more solution,&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;tab1:
Load *, AutoNumber(RowNo(),Area&amp;amp;Status) As Counter Inline [
ID, Project Name,Area,Status
100,Project A, A, backlog
101,Project B, A, backlog
106,Project C, A, backlog
110,Project D, A, inflight
111,Project E, B, complete
112,Project F, C, backlog
114,Project G, C, complete
];&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Oct 2021 13:38:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-counter-on-resident-table/m-p/1851337#M1215657</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2021-10-25T13:38:49Z</dc:date>
    </item>
  </channel>
</rss>

