Creating a Flight Details dashboard
In this exercise, you will create a dashboard to show information about airlines and flight cancellations. You can create this dashboard using the Data Discovery and Visualization application integrated into Cloudera Machine Learning.
- In Data, select the SQL tab, then select the airline data connection.
- In Database, select airline_ontime_parquet.
-
In Enter SQL below, enter this SQL statement:
Enter the table name by clicking flights in the Tables list. The database name is automatically prepended in the SQL statement.select * from airline_ontime_parquet.flights
-
Click Run.
The SQL statement executes, and the results appear in the Results tab.
-
Click New Dashboard.
The Visuals tab opens.
- In the Visuals menu, select the Table graphic type.
- In the Dimensions menu, select uniquecarrier and drag it to the Dimensions shelf.
- In the Measures menu, select Record Count and drag it to the Measures shelf.
-
In the Dimensions menu, select
cancelled and drag it to the
Measures shelf.
It appears as sum(cancelled).
- On this sum(cancelled) item, in the Field Properties, click Alias, and rename the item to Cancel Count.
- Drag the cancelled item again from the Dimensions menu to the Measures shelf.
-
For the second item, click the right arrow next to the label, and select
Enter/Edit Expression.
The expression displays in an edit pane.
-
Change the expression to the following:
sum([cancelled])/count(1)*100 as "Cancel Percent"
-
Click Save.
Note that the name of the item is changed to
"Cancel Percent"
. -
Click on Record Count, then
Alias, and change the name to
Flight Count
. -
Click on uniquecarrier, then
Alias, and change it to
Carrier
. -
Click Refresh Visual.
The column names in the visual area are updated.
-
Click and select
Clone.
The table is copied to a new area in the visual designer.
- In the new table, click Configure .
- In the Visuals menu, select Bars to create a bar chart. The table transforms into a bar chart.
-
Move items around on the shelves so that they are arranged as shown:
- X Axis: Carrier
- Y Axis: Cancel Percent
- Tooltips: Cancel Count, Flight Count
-
Click Refresh Visual.
When you move the pointer onto a bar, tooltips showing data for that bar appear.
- Click Cancel Percent, and in Field Properties, click Order and Top K.
- Select Descending.
-
Click Refresh Visual.
The bars are reordered from largest to smallest.
- In the Action menu on the graphic pane, select Edit Dataset SQL. The SQL editor page opens.
- Click on the Dataset name field, and rename it to Flight Details. Click Apply, then click Apply again in the modal window that appears.
This completes the Flight Details dashboard.