<?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: Return ID at Min/Max Location in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468647#M175043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rob and Alan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You guys are geniuses! Thanks for the help - worked like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, any idea why it underlines the expression in red when you ad the DISTINCT keyword, even thought it is an acceptable expression ("expression ok" in the expression box)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 May 2013 16:28:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-05-17T16:28:46Z</dc:date>
    <item>
      <title>Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468642#M175038</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;I'd like to create a (straight table) expression that that returns an ID (or some specified field) given the location of a min/max value. For instance, I'm using the Min() function to to find the minimum value in a range on prices, and now I'd like to move (horizontally) within the &lt;EM&gt;same &lt;/EM&gt;row on the data sheet to return a different ID (in my case, a date) at that location. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In simpler terms, if I find that the minimum purchase price of product XYZ was $1, I want to know what the date on which that product was purchased (it might have been purchased at a higher price on a different date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot simply ad the date field as an expression/dimension because it will return multiple values&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="137" style="width: 243px; border: 1px solid rgb(0, 0, 0); height: 133px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;ProductID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;MinVal&lt;/STRONG&gt;&lt;BR /&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date@Min&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;$1&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;$4&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;$5&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;$2&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;$3&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 20:50:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468642#M175038</guid>
      <dc:creator />
      <dc:date>2013-05-16T20:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468643#M175039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=DATE(FIRSTSORTEDVALUE(Datefield,-MinVal))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is how it looks on my App, I have different fields of Course!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="41209" class="jive-image-thumbnail jive-image" onclick="" alt="2013-05-16_2200.png" src="https://community.qlik.com/legacyfs/online/41209_2013-05-16_2200.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 21:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468643#M175039</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2013-05-16T21:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468644#M175040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works perfectly!... in most cases. What if the min/max value appears in the data several times on several different dates (the product ID was purchased at the same min value on 3 different dates, for instance). In that case, I'm returning a '-' because there are multiple selections from which to choose. I don't care too much which date it chooses, as long as I have one for reference. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 03:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468644#M175040</guid>
      <dc:creator />
      <dc:date>2013-05-17T03:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468645#M175041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add the DISTINCT keyword in the FirstSortedValue() function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 04:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468645#M175041</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2013-05-17T04:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468646#M175042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Rob's answer below, can you give out the points please! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 07:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468646#M175042</guid>
      <dc:creator>rustyfishbones</dc:creator>
      <dc:date>2013-05-17T07:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468647#M175043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rob and Alan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You guys are geniuses! Thanks for the help - worked like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, any idea why it underlines the expression in red when you ad the DISTINCT keyword, even thought it is an acceptable expression ("expression ok" in the expression box)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 16:28:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468647#M175043</guid>
      <dc:creator />
      <dc:date>2013-05-17T16:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468648#M175044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's just a case of the syntax checker being wrong. There are a few examples of this. Like the "WHEN" prefix which always flags as red:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when A=1 load * from myfile.csv;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 19:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468648#M175044</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2013-05-20T19:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Return ID at Min/Max Location</title>
      <link>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468649#M175045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a similar note, what if I want to use FirstSortedValue to find the location one &lt;EM&gt;larger &lt;/EM&gt;than the minimum (minID+1), or one &lt;EM&gt;smaller&lt;/EM&gt; than the maximum (maxID-1)? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume it would be something similar to the above suggestion, but adding a "+1" or "-1" somewhere, but I can't get it to work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;=DATE(FIRSTSORTEDVALUE(Datefield,-MinVal&lt;STRONG&gt;+1&lt;/STRONG&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 14:52:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-ID-at-Min-Max-Location/m-p/468649#M175045</guid>
      <dc:creator />
      <dc:date>2013-06-18T14:52:32Z</dc:date>
    </item>
  </channel>
</rss>

