<?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 Comparing new records with old ones in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336881#M494217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If two or more criteria are met, the expression should display the first encountered difference. This means that the expression should 'show the lowest value'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 12:37:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-12T12:37:00Z</dc:date>
    <item>
      <title>Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336878#M494214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the example as attached. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each SKUnr has a generic number, which means that the SKU creation and its numbers follow a chronological order (X2 is newer than X1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My goal: &lt;/P&gt;&lt;P&gt;For each SKUnr a check should be done on previous SKUnrs. The first SKUnr is the first reference. There is a logic behind this: &lt;/P&gt;&lt;P&gt;Does SKUnr have: \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0. No reference --&amp;gt; display "0"&lt;/P&gt;&lt;OL start="1"&gt;&lt;LI&gt;new ProdGroup --&amp;gt; display “1”&lt;/LI&gt;&lt;LI&gt;new Color --&amp;gt; display “2”&lt;/LI&gt;&lt;LI&gt;new size --&amp;gt; display “3”&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When an expression can be formulated the result will be as follows (ExpressionCheck is the desired column with an expression): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 550px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl23" height="17" style="text-align: center;" width="110"&gt;SKUnr&lt;/TD&gt;&lt;TD class="xl23" style="text-align: center;" width="110"&gt;ProdGroup&lt;/TD&gt;&lt;TD class="xl23" style="text-align: center;" width="110"&gt;Color&lt;/TD&gt;&lt;TD class="xl23" style="text-align: center;" width="110"&gt;Size&lt;/TD&gt;&lt;TD class="xl23" style="text-align: center;" width="110"&gt;ExpressionCheck&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X1&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;A&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;10&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X2&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;A&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;10&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X3&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;A&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;20&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X4&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;B&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;10&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X5&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;B&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;15&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl22" height="17" style="text-align: center;"&gt;X6&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;B&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;2&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;15&lt;/TD&gt;&lt;TD class="xl22" style="text-align: center;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really hope someone could help me, any help will be highly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Ramon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 08:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336878#M494214</guid>
      <dc:creator />
      <dc:date>2012-04-04T08:26:57Z</dc:date>
    </item>
    <item>
      <title>Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336879#M494215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there anyone who might give me some tips here? I could really use some help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is fantastic!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ramon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 11:57:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336879#M494215</guid>
      <dc:creator />
      <dc:date>2012-04-12T11:57:03Z</dc:date>
    </item>
    <item>
      <title>Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336880#M494216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if a row has both new Color and new Size?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/21613"&gt;Magnus Åvitsland&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.framsteg.com" target="_blank"&gt;Framsteg Business Intelligence Corp.&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 12:34:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336880#M494216</guid>
      <dc:creator>magavi_framsteg</dc:creator>
      <dc:date>2012-04-12T12:34:05Z</dc:date>
    </item>
    <item>
      <title>Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336881#M494217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If two or more criteria are met, the expression should display the first encountered difference. This means that the expression should 'show the lowest value'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how to solve this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 12:37:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336881#M494217</guid>
      <dc:creator />
      <dc:date>2012-04-12T12:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336882#M494218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ramon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could maybe work out a solution by sorting your input table and using peek() function to check for a change in values, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RESULT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NoConcatenate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD SKUnr,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProdGroup,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Color,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(isnull(peek(SKUnr)), 0,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(peek(ProdGroup) &amp;lt;&amp;gt; ProdGroup, 1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(peek(Color)&amp;lt;&amp;gt;Color, 2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(peek(Size)&amp;lt;&amp;gt;Size, 3)))) as Expressioncheck&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resident Sheet1$ order by ProdGroup, Color asc, Size asc;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;drop table Sheet1$;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's kind of unclear to me if a check on change in value is sufficient (Above will e.g. only work if you need to check for a new Size for the same Color, not for a global new Size over all Colors) or if you need to do something more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above reproduces your expected outcome and may serve you as a starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: If you have loaded the table in above sorted order, you could also use as expression in your table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;aggr(&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; if(isnull(above(total SKUnr)), 0,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(above(total ProdGroup) &amp;lt;&amp;gt; ProdGroup, 1,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(above(total Color)&amp;lt;&amp;gt;Color, 2,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(above(total Size)&amp;lt;&amp;gt;Size, 3)))) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;, ProdGroup, Color, Size)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to achieve similar, but regard selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 12:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336882#M494218</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-04-12T12:37:20Z</dc:date>
    </item>
    <item>
      <title>Comparing new records with old ones</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336883#M494219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Stefan. If I am correct, the peek function can only be used in the script. Is there a possibility I obtain the same result, but only using an expression in a chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 13:07:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-new-records-with-old-ones/m-p/336883#M494219</guid>
      <dc:creator />
      <dc:date>2012-04-12T13:07:26Z</dc:date>
    </item>
  </channel>
</rss>

