Data preparation for analysis | Prepare data and create Tableau Dashboard

Contents

This article was published as part of the Data Science Blogathon.

Introduction

Visual analysis can tell users the story of the data and helps reveal various relationships that are not easily identified in conventional reports..

In this article, I talk about the way that I made a single dashboard in Tableau for disclosing the information provided by the source data I collected from a humanitarian inquiry point, ReliefWeb, supported by the United Nations Office for the Coordination of Humanitarian Affairs (OCHA).

I downloaded the pdf file about the report – UNICEF refugee and migrant response in Europe: Humanitarian situation report n. ° 39 (of the 1 from january to 31 March 2021)”.

In this article, I am explaining some common steps that you may have to take while preparing for analysis, how to calculate new fields and highlight various actions to improve visualizations and reveal hidden insights.

So now we have the data and the next step is to generate information from this. Let us begin!

How to prepare the data?

The first is the first, we have to make sure that all the data is placed correctly in the dimensions and measures section and we have to clean the Data panel.

We can say that in the data analysis workflow, data preparation it is a critical stage. As we further refine the data, we may only need some selected fields from the source file for our analysis. Also sometimes we need to calculate fields from existing fields to describe the history of our data clearly.

Dimensions and measurements:

Tableau sorts the data in two (you can see the split in the Data pane): Dimensions and Measurements, where the first denotes qualitative data (color blue) and the second denotes quantitative data (green color). But nevertheless, record id or serial number is numeric and does not need to be added (sum or average), then grouped in the Dimensions section.

1cul4dd2aqsrbjydjc-jmww-3004305
Data preparation is a critical step in data analysis. image credits: pixabay.com

Some common methods you can apply in preparing your data:

Tableau has many advantageous built-in functions that can transform cumbersome calculations into simple.

You can select the appropriate field from the left panel and calculate the new measures of that. If you want to create a new measure, in the top menu, in “Analysis”, select “Create calculated field” and write the formula to create the new measure. Example: DATEDIFF ('minute', [Starting Time], [Finishing Time]), this formula returns a difference of Starting Time Y Finishing Time using 'minute’ as the unit and can be used for trend analysis.

An example to calculate dimension is the calculation of weekends and working days:

IF DATEPART(‘day’, [StartingTime]) = 1
OR
DATEPART(‘day’, [Starting Time]) = 7
THEN
‘Weekend’
ELSE
‘Weekday’
END

What's more, to divide information into tiny pieces with various perspectives, we may need to apply slice and dice often in data preparation. For instance, if you want to extend the data by defining time blocks. This can be made up of four six-hour periods: Evening (12 am-6 am). Tomorrow (6 a. M. A 12 p. M.), Late (12 p. M. A 6 p. M.) Y Evening (6 p. M. A 12 a. M.). So the formula can be written as follows:

IF 
DATEPART('hour', [Starting Time])>=0 
AND 
DATEPART('hour', [Starting Time]) < 6 
THEN 'Night' 
ELSEIF 
DATEPART('hour', [Starting Time])>=6 
AND
DATEPART('hour', [Starting Time]) < 12
THEN 'Morning'
ELSEIF DATEPART('hour', [Starting Time])>=12
AND
DATEPART('hour', [Starting Time]) < 18 
THEN 'Afternoon' 
ELSE 'Evening' 
END

Highlighter pen– It is a useful tool for finding patterns and identifying and highlighting data while keeping the context of all the data in the view. Example: in the top menu, select “Analysis”> “Highlighters”> “Field name”.

To modify the default properties, right-click on the field name in the Data pane. In “Default properties”> “Number format”, select “Number (personalized)” and you can specify the details in the open window like screenshot below.

1z1iwenss4ysmnsvgnqivwa-3619817
Default properties can be changed for required fields

To show filter window with Apply button, Right-click on your field to filter and click “show filter”. A small box will be displayed in the legend to filter on the selected field. Then, click the drop-down icon in the upper right and, in “Personalize”, select “Show Apply button”.

During the preparation process, you may need to clean the table a lot and, sometimes, combine sorting and filtering.

1vrmnx294ccb3wfx-ftx1sg-5908220
excluding fields from table

Exploratory trend analysis using visualizations:

We can find trends in the data using a date and time field, how to examine various patterns of seconds, The time, year, etc.

Discrete and continuous time analysis:

Tableau is great for displaying time as Discrete or Continuous when applied to a visualization. When dragging a date field onto the canvas, you will have to decide if you want it continuous or unobtrusive and at what level you want it to be featured (example: the day value, time, minute).

You can change the display type to “Line”, “Area”, “bar”, etc. in the Trademark card. To change the title in the dialog box, you can double click the x axis or y axis. To change the format of the x-axis labels, you can right-click on an x-axis label and you can perform “Format”. To activate brand labels, in the Trademark card, select the T icon to “Label” and then check “Show tag marks”. What's more, the use of “Quick calculation of tables”, You can also make calculated measurements so easy and fast.

1pk1urey3ogequri1_kdafg-8967739
Quick calculation of tables

You can see the difference between computation through versus down table. If we did the cross calculation, we would obtain the distribution of values ​​in the table. One is not necessarily better than the other, It just depends on what you are looking for! Both are often worth exploring.

What's more, Tableau allows us to quickly create creative visualizations such as Bubble chart. By looking at all the bubbles together, we can analyze the general trends of our analysis by the area of ​​the colors and the other field also by the size of all the bubbles in that field.

1goensj8wnbebpajh8fpx0a-4439753
an example of a bubble chart in Tableau

That is enough to prepare for the analysis.. There are several ways to get an answer to your question by analyzing the problem separately. The best solution would be a control panel that allows you to filter interactively!! In the next part, we will gather the data in an interactive panel so that the resolution of our questions is very simple.

The media shown in this article is not the property of DataPeaker and is used at the author's discretion.

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.