# 02 Lab [en] - Data visualization
###### tags: `Data Visualization` `Sales anaylsis`.
[TOC]
# Introduction - purpose of the exercise
During the lab you are to prepare a dashboard *(dashboard)* consisting of six sheets - visualisations *(sheets)* prepared in Tableau.
The presentation should include an analysis of sales and profit in a model enterprise over the last 4 years - [Fig.0](#rys0). Particular emphasis in this exercise will be placed on:
* formatting the visualisation elements,
* defining filters,
* defining interactions in dashboards
* analysis of the financial data.
<a id="rys0"></a>
[](https://public.tableau.com/views/salesandprofitanalysis_16475128126410/Salesandprofitanalysis?:language=en-US&:display_count=n&:origin=viz_share_link)
<center><small>Rys.0 Dashboard.</small></center></div>.
# 1. Basic information
## 1.1 Data source
The data source is the file *"Sample - EU SuperStore"* embeded in Tableau. Please, after opening this data source in Tableau, check that the appropriate data types have been assigned to each column (pay particular attention to *Order Date*, *City*, *Country*). We use the *Orders*, *People* and *Returns* worksheets for the analysis.
An alternative data source is a PostgreSQL relational database. Below are the database access details:
* server (for Tableau connection definition): bi.ekonomia.umcs.pl,
* data management tool: http://bi.ekonomia.umcs.pl/phpPgAdmin/,
* user: bi2021,
* database name: 2021Superstore.
## 1.2 The order in which the visulisation is prepared
I propose the following sequence of visualisations:
1. Sales - city and province maps
2. Sales vs profit
3. customer segment analysis
4. profit ratio
5. subcategory and product - profit analysis
# 2 Preparation of visualisation
## 2.1 Sales - city and province maps
First map shows the sum of sales in privinces on a map background. This figure is an example of [cartogram](https://en.wikipedia.org/wiki/Cartogram).

The second figure presents the sales divided into 3 category as Pie chart on map background. The angle in pie chart is calculated according to sales and the color is set to category. To combine the pie and map charts use the dual axis option in rows (Latitude should be copied from map chart).

## 2.2 Sales vs profit analysis
To show sales vs profit we chould use complex visualization which consists of two data series: *sales* and *profit*. Both series should be drawn on their own axis (profit on dual axis). Change the chart type to bar for *Sales* and line for *Profit*.

## 2.3 Analysis of sales by customer segment
Please format the visualisation as in the figure below. Please romove vertical axis and grid lines from the drawing and color it with a *segment* measure.

## 2.4 Profit trend
In the next step you need to make a graph illustrating the trend (function in time) of the profit for each product category in each customer segment - as in the figure below. Please, copy measure profit ratio to receive second series for circle chart and describe every point with a label (profit ratio).

## 2.5 Sub-category and product - profit analysis
Make a triple visualisation, illustrating the profit ratio, profit at the level of product subcategories (1, 2) and individual products within a subcategory (3).

# 3. Dashboard
Please prepare a dashboard of your own design integrating the prepared visualizations. An example of a dashboard is in [Fig.0](#rys0) . Please pay attention to the on-line dashboard operation (filters on individual charts).