Explore Courses Blog Tutorials Interview Questions
0 votes
in BI by (17.6k points)

I have a spreadsheet of flight delay data, and I'm working on a worksheet that shows the total delay time per airport. I want to filter the dimension "Airports", i.e. create categories of airports, "Small", "Medium" and "Large", based on the number of departures from each airport, which is calculated by counting the Dimension "Flight Number".

I currently have an IN/OUT filter using a set "Small Airports", created on the dimension "Airports" based on the condition

COUNT([Flight Number])<500,

but this method only lets me divide the airports into two categories.

Here's a sample of the columns I'm referring to, it's copied into an Excel sheet as the sheet I'm actually using in Tableau has over 30 columns;extract from the database into an Excel sheet

1 Answer

0 votes
by (47.2k points)
  • You can use a calculated field based on the COUNT([Flight Number]). This field can be used as a filter or a dimension for size, color, etc. on the visualization.

IF COUNT([Flight Number]) < 500 THEN "Small" ELSEIF COUNT([Flight Number]) < 1000 THEN "Medium" ELSE "Large" END

Related questions

Browse Categories