How to Chart Top perfomers

    Have you ever wondered how to chart top value performing dimensions such as top customers  or top selling product

     

     

     

    Data Model

     

    LOAD * INLINE [
    Customer, Sales, Product, SalesPerson
    ACustomer, 10000, HP-001, John
    BCustomer, 25000, HP-001, Frank
    BCustomer, 30000, HP-002, David
    CCustomer, 35000, HP-003, Mike
    CCustomer, 15000, HP-003, Susan
    CCustomer, 45000, HP-002, Susan
    ACustomer, 55000, HP-002 ,David
    ACustomer, 90000, HP-001, Sarah
    ACustomer, 70000, HP-003, Frank
    ]
    ;

     

     

    Save the Document and reload your script

     

     

    To Chart the Top 2 Customers

     

     

    1. On the Document Creat a new Chart àPivot Table and check the Bar chart (Fast Type)

     

     


    On the Dimension add a calculated dimension

     

     

    = if (aggr(rank(sum(Sales)),Customer) <=2 ,Customer)

     

    This is an aggregated over the customer that returns the Top 2 customers in terms of Sales

     

     

    In the expression tab add

     

     

    Aggr(sum(Sales),Customer)

     

     

    On the Dimension tab

    Check  - Suppress when value is Null

     

    On the General Tab  - windows Title

     

     


     

    To Chart the Top 2 Sales Person aggregated over customers

     

     

    1. On the Document Creat a new Chart àPivot Table and check the Bar chart (Fast Type)

     

     


    On the Dimension add a calculated dimension

     

    =if(Aggr(rank(sum(Sales)),Customer,SalesPerson)=1,SalesPerson)

     

    And add Customers as secondary dimension

     

     

    This is an aggregated over the Salesperson and customer that returns the Top 3 Salesperson over the customers in terms of Sales

     

     

    In the expression tab add

     

     

    aggr(sum(Sales),Customer,SalesPerson)

     

     

    On the Dimension tab

    Check  - Suppress when value is Null

     

    On the General Tab  - windows Title

     

    Top 3 Sales Person