<?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 Expression to compare with first value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296214#M497658</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Matt, but seems the results change when we change the order. I need an expressions that returns always the first Quantity value from the first purchase for each product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Nov 2011 15:43:57 GMT</pubDate>
    <dc:creator>rfigueroa</dc:creator>
    <dc:date>2011-11-04T15:43:57Z</dc:date>
    <item>
      <title>Expression to compare with first value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296212#M497656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the example attached, I would like to add a fourth column so their value will be the current Quantity minus the Quantity value from the first Purchase for the same Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example for product A, Fx will be Qty - 10 which is the value from the first purchase:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;productID&amp;nbsp; dtPurchase&amp;nbsp; Quantity&amp;nbsp; Fx &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/02/2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/03/2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that's very simple for you guys...hope can you help me.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 01:44:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296212#M497656</guid>
      <dc:creator>rfigueroa</dc:creator>
      <dc:date>2011-11-04T01:44:53Z</dc:date>
    </item>
    <item>
      <title>Expression to compare with first value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296213#M497657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Roberto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try top(Quantity) as you'r expression - it works for me in your example file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can of course use top(total Quantity) to take the very first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 10:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296213#M497657</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-11-04T10:06:27Z</dc:date>
    </item>
    <item>
      <title>Expression to compare with first value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296214#M497658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Matt, but seems the results change when we change the order. I need an expressions that returns always the first Quantity value from the first purchase for each product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 15:43:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296214#M497658</guid>
      <dc:creator>rfigueroa</dc:creator>
      <dc:date>2011-11-04T15:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to compare with first value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296215#M497659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to be working, though I didn't check it particularly carefully:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Quantity-firstsortedvalue(total &amp;lt;productID&amp;gt; Quantity,dtPurchase)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 22:35:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296215#M497659</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-11-04T22:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to compare with first value</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296216#M497660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;works perfect! thank you John.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Nov 2011 00:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-to-compare-with-first-value/m-p/296216#M497660</guid>
      <dc:creator>rfigueroa</dc:creator>
      <dc:date>2011-11-05T00:12:03Z</dc:date>
    </item>
  </channel>
</rss>

