<?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: Date associated with Min(quantity) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284809#M105900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many Thanks Miguel for your correct solution and for the fast response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards. Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2011 15:09:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-07T15:09:43Z</dc:date>
    <item>
      <title>Date associated with Min(quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284807#M105898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have created a simple table with data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Machine&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;Quantity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to display the minimum and maximum quantities achieved on a machine along with the date they were achieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like -&amp;nbsp; 'Minimum Quantity ' &amp;amp; [Quantity] &amp;amp; ' Achieved on '&amp;nbsp; then the Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I reference the Date associated with the minimum and maximum quantities ?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 14:45:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284807#M105898</guid>
      <dc:creator />
      <dc:date>2011-12-07T14:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date associated with Min(quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284808#M105899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming the following script:&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;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Machine, Date, Quantity&lt;/P&gt;&lt;P&gt;A, 01/01/2011, 200&lt;/P&gt;&lt;P&gt;B, 01/04/2011, 100&lt;/P&gt;&lt;P&gt;A, 01/03/2011, 300&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And using the following expression in a new text object&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;='Mininum Qty is ' &amp;amp; Min(Quantity) &amp;amp; ' and was achieved on ' &amp;amp; FirstSortedValue(Date, Quantity)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return as expected. Similarly with the maximum quantity:&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;='Maxinum Qty is ' &amp;amp; Max(Quantity) &amp;amp; ' and was achieved on ' &amp;amp; FirstSortedValue(Date, -Quantity)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note in this case how the FirstSortedValue() gets two parameters, the field to return (Date) and which value to sort by (Quantity desceding, hence the "-").&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;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 15:01:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284808#M105899</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-12-07T15:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Date associated with Min(quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284809#M105900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many Thanks Miguel for your correct solution and for the fast response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards. Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 15:09:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-associated-with-Min-quantity/m-p/284809#M105900</guid>
      <dc:creator />
      <dc:date>2011-12-07T15:09:43Z</dc:date>
    </item>
  </channel>
</rss>

