8 Replies Latest reply on Apr 30, 2018 4:26 PM by Deepak Rai

    creating a range and then using it to rank

    anil aggarwal

      As a new Tableau user I am not too familiar with some cncepts. Any help is appreciated

       

      I need to find total of sales by customer, which I can do by creating a variable   maxsales as sum(sales).

       

      Once maxsales for each customer is created, next  step is to create a range and group it in 5 classes of maxsales

       

      I created a new variable range as  (max(maxsales) - min(maxsales))/5; I need to keep this constant when I assign ranks (however this changes with each customer)

       

      I created ranks using ranksales as

       

      if maxsales <min(maxsales) +range then  5

      elseif maxsales <min(maxsales + 2* range then 4

      etc.

       

      problem I have is range keeps changing based on each customer . any help would be appreciated

       

      I guess my question is how can I keep range as constant number and not change with each customer; same for ranking within group. Thanks

       

       

       

       

      customersales
      124.95
      224.95
      324.95
      47.99
      115.98
      17.99
      27.99
      37.99
      415.98
      57.99
      515.98
      39.99