<?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 Calculated Dimension: Selecting top 10 by value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442080#M489070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with customer information and want to use the customer_name as a dimension in a line chart, generating a different line for each customer. Now I don't want all the customers to be in the dimension. Only my Top 10 customers by turnover. I have calculated the turnover per customer in the script so it is added to the customers-table. This gives these fields in the table: Customer_Number, Customer_Name, Customer_Turnover.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has to be done in the front-end, because the selection of clients can change. If I select only 100 of the 1000 customers, I want the top ten of these 100, not of the 1000 customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried as a calculated dimension using following expression: if(Customer_Turnover &amp;gt; FirstSortedValue(Customer_Turnover,Customer_Turnover,10),Customer_Name) but this only gives 'error in calculated dimension'. I have also tried with the Rank()-function but this didn't give me the required solution neither (again an error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a solution for something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Dec 2012 13:03:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-17T13:03:28Z</dc:date>
    <item>
      <title>Calculated Dimension: Selecting top 10 by value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442080#M489070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with customer information and want to use the customer_name as a dimension in a line chart, generating a different line for each customer. Now I don't want all the customers to be in the dimension. Only my Top 10 customers by turnover. I have calculated the turnover per customer in the script so it is added to the customers-table. This gives these fields in the table: Customer_Number, Customer_Name, Customer_Turnover.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has to be done in the front-end, because the selection of clients can change. If I select only 100 of the 1000 customers, I want the top ten of these 100, not of the 1000 customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried as a calculated dimension using following expression: if(Customer_Turnover &amp;gt; FirstSortedValue(Customer_Turnover,Customer_Turnover,10),Customer_Name) but this only gives 'error in calculated dimension'. I have also tried with the Rank()-function but this didn't give me the required solution neither (again an error).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have a solution for something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 13:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442080#M489070</guid>
      <dc:creator />
      <dc:date>2012-12-17T13:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension: Selecting top 10 by value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442081#M489071</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;Did you try using the tab "Dimension Limits" in the chart properties? Set it to restrict values showing only the 10 largest, according to the first expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, you will need an expression like the following:&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 _jivemacro_uid_1355750071506732" jivemacro_uid="_1355750071506732"&gt;&lt;P&gt;=If(Aggr(Rank(Aggr(Sum(TurnOver), Customer_Name)), &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Customer_Name&lt;/SPAN&gt;) &amp;gt; 0 AND Aggr(Rank(Aggr(Sum(TurnOver), &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Customer_Name&lt;/SPAN&gt;)), &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Customer_Name&lt;/SPAN&gt;) &amp;lt; 11&lt;/P&gt;&lt;P&gt;, FieldName)&lt;/P&gt;&lt;/PRE&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>Mon, 17 Dec 2012 13:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442081#M489071</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-12-17T13:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Dimension: Selecting top 10 by value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442082#M489072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can also create a input variable for customer&amp;nbsp; and add the variable in Dimension limits to restirct the no of customers........ In input box if u select 10 you'll get a list of 10 customers.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 13:17:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-Dimension-Selecting-top-10-by-value/m-p/442082#M489072</guid>
      <dc:creator />
      <dc:date>2012-12-17T13:17:06Z</dc:date>
    </item>
  </channel>
</rss>

