Monday 3 November 2014

Tableau tech - Top N within another filter

Instead of the Top N, which is easy to do in Tableau, I wanted the Top N for the selected departure airport (and even for the year). It took a while to find the right search terms, but the answer is here on the Tableau site. (and on a linked page).

In brief, to get a set of line charts for the top N destination airport (ADES) from a given departure airport (ADEP) you need to do the following:
  1. Set up your line chart, with Month in the column shelf say, and one or measures in the row shelf.
  2. Filter by departure airport.
  3. Select both ADEP and ADES (ctrl-click) and create combined dimension.
  4. Drag this combo into the colour field in the measures pane, and sort by descending sum(pax) (or whatever).
  5. Create calculated field which is just Index() - I named it Rank (which is more or less what it is).
  6. Set it as discrete.
  7. Drag to the filter.
  8. Right-click and select compute using the combo field.
  9. Choose the filter values (eg 1-5).
Obvious! (I hope I recalled all those steps correctly). Here's the final dashboard  - with test data only.


[For links to dashboard - production and development versions - see top of page.]


No comments:

Post a Comment