<?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: Working out highest grouping in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143159#M374297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can try with 'FirstSortedValue', like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Level 1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;vSalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;TOP_CATEGORY&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2016 02:58:12 GMT</pubDate>
    <dc:creator>settu_periasamy</dc:creator>
    <dc:date>2016-06-20T02:58:12Z</dc:date>
    <item>
      <title>Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143155#M374293</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;I have a table, SalesCategory which works out a field called TOP_CATEGORY based on the number of sales. What I instead want is to populate TOP_CATEGORY based on the 'amount' of sales ie vSalesAmount :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSalesPerson&lt;/P&gt;&lt;P&gt;vSalesAmount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesCategory:&lt;/P&gt;&lt;P&gt;NOCONCATENATE LOAD&lt;/P&gt;&lt;P&gt;$(v&lt;SPAN style="font-size: 13.3333px;"&gt;vSalesPerson&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;Mode(LEVEL1) as TOP_CATEGORY &lt;/P&gt;&lt;P&gt;RESIDENT REPORT_STAGING&lt;/P&gt;&lt;P&gt;GROUP BY $(&lt;SPAN style="font-size: 13.3333px;"&gt;vSalesPerson&lt;/SPAN&gt;);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 15:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143155#M374293</guid>
      <dc:creator />
      <dc:date>2016-06-17T15:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143156#M374294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post some sample lines of data and your expected resulting table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 15:19:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143156#M374294</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-17T15:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143157#M374295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Stefan, not sure what you are trying to do. It would be easier to help if we have a sample to work with &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 16:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143157#M374295</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-17T16:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143158#M374296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Certainly. Here's a spreadsheet with the original sample data in the first tab and expected outcome in second tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see currently it pulls of the 'top_category' based on the highest number in column C. Instead I want it to pull the corresponding top_category based off the highest sales amount in column B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if this is not clear as I can appreciate it's the clearest example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 00:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143158#M374296</guid>
      <dc:creator />
      <dc:date>2016-06-20T00:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143159#M374297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can try with 'FirstSortedValue', like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;LOAD&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;[Level 1]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;vSalesAmount&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;TOP_CATEGORY&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 02:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143159#M374297</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2016-06-20T02:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143160#M374298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Continuing Sethu's logic further to front end....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are doing this in a text box objects, you can try this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue([Level 1], -vSalesAmount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you want this in a chart where Level 1 is a dimension:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;FirstSortedValue(TOTAL [Level 1], -vSalesAmount)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 03:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143160#M374298</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-20T03:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143161#M374299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks both. However this gives the first value which returns the corresponding category of &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="400"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="400"&gt;Management and Business Professionals and Administrative Services&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I want it to return the category relating to to the 'first highest value' so I am expecting to see returned : &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="400"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="17" width="400"&gt;Apparel and Luggage and Personal Care Products&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 10:15:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143161#M374299</guid>
      <dc:creator />
      <dc:date>2016-06-20T10:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143162#M374300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be easier to help with a sample of your records in the data model, not showing pre-aggregated data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you have sales data per person and category, and you want to show in a table the overall top category across all sales persons. Maybe something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue(DISTINCT Level1, -Aggr(Sum({1} SalesAmount), Level1) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or in the LOAD script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesPerLevel1:&lt;/P&gt;&lt;P&gt;LOAD Level1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SalesAmount) As Level1Sales&lt;/P&gt;&lt;P&gt;FROM YourSalesTable&lt;/P&gt;&lt;P&gt;GROUP BY Level1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SalesPerPerson:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD Person,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Level1,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(SalesAmount) As PersonSales&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FROM YourSalesTable&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;GROUP BY Person, Level1;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;JOIN (&lt;SPAN style="font-size: 13.3333px;"&gt;SalesPerPerson)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD FirstSortedValue( Level1, -&lt;SPAN style="font-size: 13.3333px;"&gt;Level1Sales) as TopSalesLevel1&lt;/SPAN&gt;,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;RESIDENT &lt;SPAN style="font-size: 13.3333px;"&gt;SalesPerLevel1;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 10:30:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143162#M374300</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-20T10:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Working out highest grouping</title>
      <link>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143163#M374301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ignore that ! Think I have it working now ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will update you&amp;nbsp; later once validated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 10:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-out-highest-grouping/m-p/1143163#M374301</guid>
      <dc:creator />
      <dc:date>2016-06-20T10:30:45Z</dc:date>
    </item>
  </channel>
</rss>

