<?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: Compare rows in a table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Compare-rows-in-a-table/m-p/2074490#M88140</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure it may help but try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//first transform data with a crosstable load :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[temp]:&lt;BR /&gt;crosstable(Step,Value,2)&lt;BR /&gt;LOAD * INLINE &lt;BR /&gt;[&lt;BR /&gt;JobId,Date,Step 1,Step 2,Step 3&lt;BR /&gt;A,22.05,1,1,0&lt;BR /&gt;B,22.05,1,1,1&lt;BR /&gt;C,22.05,1,0,0&lt;BR /&gt;A,20.05,1,1,1&lt;BR /&gt;B,20.05,1,0,0&lt;BR /&gt;D,20.05,1,1,0&lt;BR /&gt;](delimiter is ',');&lt;/P&gt;
&lt;P&gt;// reload data add a dimension RANK&amp;nbsp;&lt;BR /&gt;Table:&lt;BR /&gt;load *,&lt;BR /&gt;if(Value=1, right(Step,1),null()) as Rank&lt;BR /&gt;resident temp;&lt;BR /&gt;drop table temp;&lt;/P&gt;
&lt;P&gt;then in table you can do that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LAST STEP per JobID and Date :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mesure :&lt;/P&gt;
&lt;P&gt;FirstSortedValue(Step,-aggr(max(if(Value=1, right(Step,1),null())),Date,JobId,Step))&lt;/P&gt;
&lt;P&gt;PREVIOUS STEP per Job ID and Date :&lt;/P&gt;
&lt;P&gt;FirstSortedValue(Step,-aggr(max(if(Value=1, right(Step,1),null()),-1),Date,JobId,Step),2)&lt;/P&gt;
&lt;P&gt;table resulting&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brunobertels_0-1684854750831.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/107808iD76343A86FFA763C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brunobertels_0-1684854750831.png" alt="brunobertels_0-1684854750831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see the app attached&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 15:12:59 GMT</pubDate>
    <dc:creator>brunobertels</dc:creator>
    <dc:date>2023-05-23T15:12:59Z</dc:date>
    <item>
      <title>Compare rows in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-rows-in-a-table/m-p/2074047#M88093</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the data as in the table below:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;JobId&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;Date&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;Step 1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;Step 2&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;Step 3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;A&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;22.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;B&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;22.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;C&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;22.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;A&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;20.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;B&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;20.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="24px"&gt;D&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;20.05&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="24px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to analyze two things:&lt;/P&gt;
&lt;P&gt;1. I have a list of JobId that are lost from 20.05 to 22.05 ( for example D existed in 20.05, but doesn't exist anymore in 22.05). I need to find a way to show what is the last step Job D was in. In this case, we can see that it is Step 2, meaning that Job D disappeared in Step 2.&lt;/P&gt;
&lt;P&gt;2. For the common JobIds (those that are in both days, like A and B), I need to compare the steps they are in and see if the last reached step is the same. For example job A was in step 3 in 20.05, but in 22.05, is in step 2, meaning that has moved one step back.&amp;nbsp; In this case, I want to flag those sites whose steps have changed, what was the last reached step they were&amp;nbsp; 2 days ago and what is the step they are in now.&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 19:34:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-rows-in-a-table/m-p/2074047#M88093</guid>
      <dc:creator>florinaturlea</dc:creator>
      <dc:date>2023-05-22T19:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare rows in a table</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-rows-in-a-table/m-p/2074490#M88140</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure it may help but try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//first transform data with a crosstable load :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[temp]:&lt;BR /&gt;crosstable(Step,Value,2)&lt;BR /&gt;LOAD * INLINE &lt;BR /&gt;[&lt;BR /&gt;JobId,Date,Step 1,Step 2,Step 3&lt;BR /&gt;A,22.05,1,1,0&lt;BR /&gt;B,22.05,1,1,1&lt;BR /&gt;C,22.05,1,0,0&lt;BR /&gt;A,20.05,1,1,1&lt;BR /&gt;B,20.05,1,0,0&lt;BR /&gt;D,20.05,1,1,0&lt;BR /&gt;](delimiter is ',');&lt;/P&gt;
&lt;P&gt;// reload data add a dimension RANK&amp;nbsp;&lt;BR /&gt;Table:&lt;BR /&gt;load *,&lt;BR /&gt;if(Value=1, right(Step,1),null()) as Rank&lt;BR /&gt;resident temp;&lt;BR /&gt;drop table temp;&lt;/P&gt;
&lt;P&gt;then in table you can do that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LAST STEP per JobID and Date :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mesure :&lt;/P&gt;
&lt;P&gt;FirstSortedValue(Step,-aggr(max(if(Value=1, right(Step,1),null())),Date,JobId,Step))&lt;/P&gt;
&lt;P&gt;PREVIOUS STEP per Job ID and Date :&lt;/P&gt;
&lt;P&gt;FirstSortedValue(Step,-aggr(max(if(Value=1, right(Step,1),null()),-1),Date,JobId,Step),2)&lt;/P&gt;
&lt;P&gt;table resulting&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brunobertels_0-1684854750831.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/107808iD76343A86FFA763C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="brunobertels_0-1684854750831.png" alt="brunobertels_0-1684854750831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see the app attached&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 15:12:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-rows-in-a-table/m-p/2074490#M88140</guid>
      <dc:creator>brunobertels</dc:creator>
      <dc:date>2023-05-23T15:12:59Z</dc:date>
    </item>
  </channel>
</rss>

