Sunday 16 November 2014

Tableau - More on Top N

In my posts of 3 & 5 Nov, I was looking at how to plot monthly graphs for just the top N airports out of many. Originally I achieved this through a complicated method (3/11) creating a combined dimension, but it's rather easier than that.

This is for graphs of main departure airports to a single destination.
  1. As before, create a graph by putting month in the column shelf, and one or more measures in the row shelf (eg passengers and flights).
  2. Filter by year  (I only want to show a single year's seasonal cycle) and destination airport.
  3. Create a calculated field which is just Index() - I named it Rank (which is more or less what it is). Check that it's discrete.
  4. Filter on Rank, and from the drop-down select 'edit table calculation'.
  5. Choose sort by departing pax descending (so rank 1 is the biggest) - or whatever you want to rank by.
  6. In partitioning, select airport of departure.
  7. When you click OK you get the description something like: Results are computed along ADEP (sorted descending by Sum of Departing Pax) for each Month of Month. In your case, in place of ADEP (=airport of departure) you will see the dimension for each value of which you want a line on your graph.
  8. From the drop-down on rank in the filter pane, select filter and select the top N boxes, however many you want.
So, it still has quite a few steps, but it avoids calculating combo dimensions. 

You can see the results in the 'seasonality at main departure airports' graph in the DepFromAP dashboard. I decided not to make N user selectable, just adds complication for the user.



No comments:

Post a Comment