Skip to main content

Evening all,

 

Ok so I have a chart that I am trying to sort via a rank.

 

Here is the situation:

I am managing a fleet of vehicles.  Each month, the vehicle's monthly milage is recorded.  There is a business rule that says if the vehicle's monthly milage is less than 600 miles then it is considered to be "low".  For my dashboard, i have another viz that shows the cost.  I have also come up with some KPI such as the total count of vehicles and count of vehicles that have low milage.

 

For this part of the dashboard, I have created a line chart showing the monthly milage via a line graph with steps.  This is so the manager's can see the trends in their part of the fleet.  As I was working this afternoon on this, I turned the chart into a text view and got the ranking to work.  When I tried to turn the text back into the graph as shown, all I got was a dot for each vehicle tag for each month - no good!

 

What are the conditions for ranking:

 

For each vehicle tag and the max month shown, rank each vehicle tag from lowest monthly milage to highest month mileage and sort the vehicle tags in the view based upon that.

 

Another example is this:

 

In April 2018:

Vehicle ID      Milage       Rank

ABC-123          150          1

DEF-456          200          2

GHI-789          300          3

 

In May 2018:

Vehicle ID      Milage       Rank

GHI-789          175          1

DEF-456          235          2

ABC-123          376          3

 

In June 2018:

Vehicle ID      Milage       Rank

DEF-456          105          1

DEF-456          278          2

ABC-123          422          3

 

Attached is a workbook and I am working in Tableau 2018.1.

 

I am fairly new to table calcs - so this is kind throwing me for a loop.

 

Thank you in advance for your help!

 

Michael Hesser, Jim Dehner, Samuel Okate PhD

12 risposte
  1. 29 mar 2019, 14:00

    Hey Scott Carman;

     

    Will your folks need to see everything at once, or just focus on the 10 with the worst record?

    Introducing a simple filter could pare down the number of cars the user needs to concentrate on-- as long as that's within scope.

    You could make this dynamic, too, so that it limits the view to only the worst 25%... or just those cars that have have been underutilized for n number of months...

     

    You might wind up with something like this:

    Hey Scott Carman; Will your folks need to see everything at once, or just focus on the 10 with the worst record?

     

    Naturally, once you get past ~10 colors, things are going to start to look messy. Let me know if you'd like to see how I did this