<?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: Adjust field in script to contain only max value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915721#M982163</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post a qlikview document that demonstrates the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Aug 2015 16:18:19 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-08-07T16:18:19Z</dc:date>
    <item>
      <title>Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915714#M982156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table with three fields:&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Customer // Industry // Revenue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer-to-Industry is a one-to-many mapping.&amp;nbsp; However, I want to convert it to a one-to-one mapping by only referencing the industry with the max revenue.&amp;nbsp; See tables below for illustration:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Initial table:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Customer // Industry // Revenue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A // X // 100&lt;/P&gt;&lt;P&gt;A // Y // 200&lt;/P&gt;&lt;P&gt;B // Z // 300&lt;/P&gt;&lt;P&gt;B // Q // 400&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A // Y // 300&lt;/P&gt;&lt;P&gt;B // Q // 700&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do this?&amp;nbsp;&amp;nbsp; I tried using first sorted value, but to no avail.&amp;nbsp; Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 13:30:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915714#M982156</guid>
      <dc:creator />
      <dc:date>2015-08-07T13:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915715#M982157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(Industry, -Revenue)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/95369_1.png" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:02:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915715#M982157</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-08-07T14:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915716#M982158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and for script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;InitialTable:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load * inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer , Industry , Revenue&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A , X , 100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A , Y , 200&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B , Z , 300&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B , Q , 400&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Final:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;noconcatenate load&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer, sum(Revenue), &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FirstSortedValue(Industry, -Revenue)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident InitialTable&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;group by Customer; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:04:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915716#M982158</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-08-07T14:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915717#M982159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Initial_table:&lt;/P&gt;&lt;P&gt;LOAD Customer, FirstSortedValue(Industry,-Revenue) as Industry, max(Revenue) as Revenue&lt;/P&gt;&lt;P&gt;Group By Customer;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Customer , Industry , Revenue&lt;/P&gt;&lt;P&gt;A , X , 100&lt;/P&gt;&lt;P&gt;A , Y , 200&lt;/P&gt;&lt;P&gt;B , Z , 300&lt;/P&gt;&lt;P&gt;B , Q , 400&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 14:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915717#M982159</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-08-07T14:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915718#M982160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, this appears to work for most entries ... strange thing is that for some Customers, the FirstSortedValue() calc returns null, while there are records with positive revenue where Industry is not null&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so Customer A has two potential values for Industry (X, Y) and both are positive revenues, however FirstSorted.Industry = null .... happens for a bunch of customers ... any idea why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 15:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915718#M982160</guid>
      <dc:creator />
      <dc:date>2015-08-07T15:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915719#M982161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the FirstSortedValue function can return only one value it will return null if there are several possible Industry values that all have the same maximum Revenue value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915719#M982161</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-08-07T16:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915720#M982162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but in each of these cases, the max Revenues are not equal.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915720#M982162</guid>
      <dc:creator />
      <dc:date>2015-08-07T16:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Adjust field in script to contain only max value</title>
      <link>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915721#M982163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post a qlikview document that demonstrates the problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2015 16:18:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adjust-field-in-script-to-contain-only-max-value/m-p/915721#M982163</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-08-07T16:18:19Z</dc:date>
    </item>
  </channel>
</rss>

