2 Replies Latest reply: Dec 17, 2012 8:17 AM by qlikviewnext RSS

    Calculated Dimension: Selecting top 10 by value

      Hello all,


      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.


      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.


      I have tried as a calculated dimension using following expression: if(Customer_Turnover > 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).


      Does anyone have a solution for something like this?


      Thanks in advance