002old Lab [en] - Data Visualization
Introduction - exercise objective
We will practise:
- how to define calculation fields,
- the syntax of calculation formulas,
- interactivity of dashboards: defining filters and highliters,
- formatting tooltips, descriptions.
The purpose of this exercise is to prepare a visualisation that characterises the locations and types of Motorway Service Points (MOPs) along expressways and motorways in Poland.
During the classes you should prepare a dashboard (dashboard) consisting of four sheets - visualisations (sheets) prepared in Tableau. The presentation is to include the characteristics of MOP in Poland - Fig.0, Tableau Public - dashboard online.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.0 Dashboard: Motorway Service Points (MOPs) .1.1 Source data
The source data should be downloaded from the excercise desription on the Virtual Campus site (data source).
1.2 Structure of the data set
When importing a dataset, please pay attention to the types of individual data series - Fig.1
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.1 View *Data source*In order to be able to correctly geolocate the location of each MOP, you need to assign the appropriate geographical meaning to the X and Y data series (first assign them the data type number (decimal) and then change them to the appropriate Geographic role and Latitude and Longitude). Please note the data series types should be numbers.
Additionally, a unique attribute should be added to the data to act as a primary key (a value that identifies individual records) - e.g. a unique numeric attribute (column) Id.
Note
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
When importing data from Excel, you can try to use the Use data interpreter option instead of the Excell transformation.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.3 Calculated fields in the dataset
In order to prepare the visualisation, we should have a column describing the total number of parking spaces.
However, this data series is not present in the Data Source and must be defined as a Calculated Field, which sums up the values of the other series, related to the number of parking spaces for the different vehicle categories:
Fig.2 illustrates how to call up the dialog used to define the calculation fields and how to define the calculation in the field to be created.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.2. Definition of a calculation field.Defined calculated fields are visible on Data tab and are marked with =# icon - Fig.3
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.3. Representation of a calculation field.2.Preparing the visualisation in Tableau
2.1 Scatter plot
The graph should illustrate the number of parking spaces for each MOP, grouped by MOP category (MOP I, MOP II, etc). The markers should be set to Shape and the shape used for visualisation should be selected from the Marks panel - Fig.4.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.4. dot plot.The size of the marker can be related to the illustrated data series - total number of parking spaces, the colours of the markers should be related to the category of MOP.
Note
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
In order to disperse the indicators in the columns, in addition to the Category of MOP dimension, a computational measure has been used - the random() function returning a pseudo-random value in the range 0-1. This measure has been directly edited in the Columns field.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
The analytical element added to the visualization is a line indicating the average in each panel of the presentation. We add this line to the visualization by using the Analytics panel and dragging the selected method to the visualization - Fig.5.. Unnecessary average lines are removed from the chart by selecting them and choosing the Remove option. The label (and other settings) of the average line is formatted by selecting a given line and choosing edit option from the context menu.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.5. Adding analytical elements to visualization - mean.In the next step, define the appearance of the tooltip (tooltip) so that it is consistent with the view in Fig.4a.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.4a. Formatting tooltip.2.2 Number of MOP in provinces
To calculate the number of MOP in each province (Fig.5), use the COUNT or COUNTD function (functions analogous for SQL functions: count and count distinct).
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.5. Number of MOP in provinces.Menu with count function is presented in Fig. 6.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.6. Calculations: *count* and *countd*.2.3 Maps and custom shapes
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Fig.5. Map configuration.The size of the markers on the maps should depend on the total number of parking spaces at the given MOP (calculation field).
On the map visualising the location of the MOP with accommodation, so-called custom shapes have been used to illustrate the accommodation. In the map visualising the location of MOPs with accommodation facilities, so-called custom shapes were used to illustrate the accommodation facilities. Instructions on how to use this option in Tableau are available at Custom shapes. Icons for visualisation can be downloaded, for example, from fontawesome.