<?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: Select Max Value from a list of values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803068#M661416</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I typed in the field name correctly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 20:35:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-26T20:35:06Z</dc:date>
    <item>
      <title>Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803064#M661412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with two dimensions (date and code) and one expression (value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three distinct codes, RFN, NP, and PJ. Each code has a value. The value is a count of the number of times a code occurs on a specific date. I would like to select the max value from each code, and repeat it for the remaining codes on each date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example on 04-MAR-15 the max value is 5, so I would repeat 5 for each codes. On 06-MAR-15 the max value is 4 so I would like to repeat 4 for each code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table on left is what I currently have. The table on the right is what I'm trying to achieve (these are hard coded currently).&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82075_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using the statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;=if(CODE = 'NP' or CODE = 'PJ', count(distinct {$&amp;lt;prodtime_CODE ={"*"}-{'NP', 'PJ'}&amp;gt;} VALUE), count(distinct {$&amp;lt;CODE ={"*"}-{'NP', 'PJ'}&amp;gt;} VALUE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; but it removes the NP and PJ codes from the table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/82077_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how I can accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:18:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803064#M661412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-26T20:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803065#M661413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;MAX(TOTAL &amp;lt;Date&amp;gt; value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:26:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803065#M661413</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-03-26T20:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803066#M661414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That removes everything from the table.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82082_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803066#M661414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-26T20:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803067#M661415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did I typed your field name correctly? value &amp;lt;&amp;gt; Value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:32:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803067#M661415</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-03-26T20:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803068#M661416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I typed in the field name correctly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803068#M661416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-26T20:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803069#M661417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;max( total &amp;lt;Code&amp;gt; aggr( sum(Value),Code,Date) )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:39:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803069#M661417</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-26T20:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803070#M661418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;MAX(TOTAL &lt;/SPAN&gt;&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Date&lt;/SPAN&gt;&amp;gt; AGGR( SUM (Value),Code,Date) )&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:41:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803070#M661418</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-03-26T20:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803071#M661419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is closer, but still not quite right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It applies the max value between NP and PJ to the NP and PJ codes, but it does not apply the max value of RFN.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82083_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:45:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803071#M661419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-26T20:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803072#M661420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;interesting.&amp;nbsp; i got different results when i typed in your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have hidden (but important) details in your app that you may need to share...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82084_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 20:47:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803072#M661420</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-26T20:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803073#M661421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI MIchael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this may seem a daft question, but why do you want to do this, what are you trying to achieve eventually? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 10:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803073#M661421</guid>
      <dc:creator>awhitfield</dc:creator>
      <dc:date>2015-03-27T10:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803074#M661422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help so far everybody.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a slightly more long-winded version of what I'm trying to accomplish. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a multiple employees who can work three types of jobs-- RFN, NP, and PJ. I have a table that includes a date, employee, job type (Code), and hours worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to show is the average amount of hours worked in each code per employee per date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I had 5 separate employees work on 02-MAR-15. I want to take (sum(RFN hours) / 5), (sum(NP hours) / 5), and (sum(PJ hours) / 5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I am only able to divide by the number of employees that have hours worked for the specific job type. So, on 02-MAR-15 for PJ hours I want 1.5 / 5 = 0.3. What I am getting is 1.5 / 1 = 1.5. And for NP hours I want 16.54 / 5 = 3.31, but it returns 16.54 / 4 = 4.135.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately I want a table with three columns: date, code, and hours. Each date would have a separate row for RFN, PJ, and NP. The hours worked would represent the total amount of time spent working in each code divided by the total number of operators who worked that day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the help so far. Let me know if there is anything other information that would be pertinent. &lt;SPAN style="font-size: 13.3333330154419px;"&gt;This in all likelihood much easier than I am trying to make it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82190_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 20:02:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803074#M661422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-27T20:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803075#M661423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My answer is as follows and attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( total &amp;lt;Date,Code&amp;gt; Hours)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;count(DISTINCT total &amp;lt;Date&amp;gt; Inits)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/82275_Capture.PNG" style="height: 429px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 03:13:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803075#M661423</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-03-30T03:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select Max Value from a list of values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803076#M661424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan-- that works perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 02:18:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Max-Value-from-a-list-of-values/m-p/803076#M661424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-31T02:18:44Z</dc:date>
    </item>
  </channel>
</rss>

