Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

Experiment - 1

Aim: Introduction to Tableau

Tools Required: Tableau Desktop

Theory:

Tableau is a top data visualization tool with unique features like a drag-and-drop interface, easy
data discovery, and easy database combination. It simplifies business problem analysis and sharing,
making it a valuable tool for data visualization.

Tableau Features:

Tableau provides solutions for all kinds of industries, departments, and data environments.
Following are some unique features which enable Tableau to handle diverse scenarios.

 Speed of Analysis − As it does not require high level of programming expertise, any user
with access to data can start using it to derive value from the data.
 Blend Diverse Data Sets − Tableau allows we to blend different relational, semi structured
and raw data sources in real time, without expensive up-front integration costs.
 Centralized Data − Tableau server provides a centralized location to manage all of the
organization's published data sources. It's easy to schedule extract refreshes and manage
them in the data server.

Tableau - Environment Setup:

 Download Tableau Desktop


Tableau Desktop offers the Free Personal Edition, which requires registration and
installation. The setup process includes accepting the license agreement and providing the
target folder. The following steps and screenshots describe the entire setup process.
 Start the Installation Wizard
Double-click the TableauDesktop-64bit-9-2-2.exe. It will present a screen to allow the
installation program to run. Click “Run”.

 Accept the License Agreement


To install the software, read the license agreement, agree to its terms, and click "Install".
 Start Trial
After installation, the screen prompts to start the trial now or later, and if we've purchased
Tableau, we can enter the License key.

 Provide Wer Details


Provide wer name and organization details. Then, click "Next".

 Registration Complete
The registration completion screen appears. Click "Continue".
 Verify the Installation
We can verify the installation by going to the Windows start menu. Click the Tableau icon.
The following screen appears.

We are now ready to learn Tableau.

Tableau Desktop Interface:

Next up is the tableau desktop interface, let us understand all about its interface. Tableau Desktop’s
interface, or the workspace, consists of menus, a toolbar, cards, shelves, data and analytics pane,
different sheets for creating reports, dashboards, and stories.

The following is what the Tableau Desktop interface looks like:


Dimensions and Measures in Tableau

Once the dataset is loaded, Tableau automatically divides the data into dimensions and measures.
We can see this in the workspace area under the data pane.

Dimensions are usually categorical fields that cannot be aggregated, while measures are numerical
fields that can be measured, aggregated, or manipulated.

Dimensions are marked in blue, while measures are marked in green.

Tableau - Get Started:

This teaches basic operations in Tableau, including connecting to a data source, selecting
dimensions and measures, and applying visualization techniques. It uses a sample data set from
Tableau installation, Ecommerce Data, to demonstrate the interface.

 Connect to a Data Source:

Open Tableau, select data sources, choose file or server, and navigate to Excel file "Ecommerce
Data.xlsx" with Orders, People, and Returns sheets.
 Choose the Dimensions and Measures:

Select data dimensions and measures, comparing descriptive and numeric data. Choose Category
and Region as dimensions and Sales as measures. Drag and drop to display total sales in each
category and region.

 Apply Visualization Technique:

The data is presented as numbers, but can be viewed as graphs or charts with different colors for
quicker judgment. By dragging and dropping the sum column, the table automatically becomes a
bar chart.
The text suggests adding another dimension to existing data to enhance the color palette of a bar
chart, as demonstrated in a screenshot.

Tableau – Show Me:


As an advanced data visualization tool, Tableau makes the data analysis very easy by providing
many analysis techniques without writing any custom code. One such feature is Show Me. It can be
used to apply a required view to the existing data in the worksheet. Those views can be a pie chart,
scatter plot, or a line chart.
Whenever a worksheet with data is created, it is available in the top right corner as shown in the
following figure. Some of the view options will be greyed out depending on the nature of selection
in the data pane.
Tableau - Data Types:
As a data analysis tool, Tableau classifies every piece of data into one of the four categories namely -
String, Number, Boolean and Datetime. Once data is loaded from the source, Tableau automatically
assigns the data types. Contrarily, we can also change some of the data types if it satisfies the data
conversion rule. The user has to specify the data type for calculated fields.
Following table lists the description of data types supported by Tableau.

Data Type Description Example

Any sequence of zero or more characters. They are enclosed 'Hello' 'Quoted'
'quote'
STRING within single quotes. The quote itself can be included in a
string by writing it twice.

These are either integers or floating points. It is advised to


3
NUMBER round the floating point numbers while using them in
calculations. 142.58
BOOLEAN They are logical values. TRUE
FALSE

Tableau recognizes dates in almost all formats. But in case we


DATE & "02/01/2015"
need to force Tableau to recognize a string as date, then we
DATETIME "#3 March 1982"
put a # sign before the data.

Tableau - Data Sources:

Tableau can connect to all the popular data sources which are widely used. Tableau’s native
connectors can connect to the following types of data sources.

 File Systems such as CSV, Excel, etc.


 Relational Systems such as Oracle, Sql Server, DB2, etc.
 Cloud Systems such as Windows Azure, Google BigQuery, etc.
 Other Sources using ODBC

The following picture shows most of the data sources available through Tableau’s native data
connectors.
 Connect Live: The Connect Live feature enables real-time data analysis by connecting to a
real-time data source, ensuring the latest changes are reflected, but also burdens the source
system.
 In-Memory: Tableau can process data in-memory, caching it in memory and not connecting
to the source, with limitations on data cached based on memory availability.
 Combine Data Sources: Tableau offers a unique feature of data blending, allowing
simultaneous connections to different data sources, such as flat files and relational sources
in a single workbook.

Tableau - Custom Data View:

Custom data views extend normal data views with additional features, providing different types of
charts for the same data. These views can drill down dimension fields within a pre-defined
hierarchy.

 Swapping Dimensions:

To create a new view from an existing one, swap dimensions without altering measures. For
example, to analyze Profit for each year for each product segment, drag a vertical line to the
segment column.

The result of the swapping of the two dimensions is shown in the following screenshot. As it can be
seen, only the position of the values of the measure Profit changes for each category and segment,
and not its value.
Tableau - Data Joining:

Tableau offers data joining for data analysis, allowing users to join tables from multiple sources or
tables in a single source using the Edit Data Source feature.

 Creating a Join:

Create a join between Orders and Returns tables using Ecommerce data source, edit data
source, and drag tables to data pane. Tableau will automatically create joins. The following
screenshot shows the creation of an inner join between Orders and Returns using the Field
Order ID.
Tableau - Add Worksheets:

Tableau's worksheet area allows users to create data analysis views, with three default blanks
provided upon data source connection. Multiple worksheets can be added for multiple views.

 Adding a Worksheet:

To add a worksheet, right-click on the current worksheet's name and select "New Worksheet" from
the pop-up menu, or click on the small icon to the right of the last sheet name.

Tableau – Functions:

Any data analysis involves a lot of calculations. In Tableau, the calculation editor is used to apply
calculations to the fields being analyzed. Tableau has a number of inbuilt functions which help in
creating expressions for complex calculations.

Following are the description of different categories of functions:

 Number Functions: Numeric functions, such as CEILING, POWER, and ROUND, are used to
round numbers to the nearest integer, raise them to a specified power, or round them to a
specified number of digits.
 String Functions: String functions are essential for string manipulation, including LEN,
LTRIM, REPLACE, and UPPER. They return the string's length, remove leading spaces,
search for substrings, and return uppercase strings.
 Date Functions: Tableau offers various date functions for calculations involving dates,
using the date_part as a string. Examples include DATEADD, which adds an increment to
the date, DATETENAME, which returns the date_part of the date, DAY, which returns the
day of the given date, and NOW, which returns the current date and time.
 Logical Functions: These functions evaluate a single value or expression result and
produce a boolean output. Examples include IFNULL (expression1, expression2), ISDATE
(string), and MIN(expression). They return TRUE if the result is null, FALSE if it cannot, and
return the minimum expression across all records.
 Aggregate Functions:

Function Description

Returns the average of all the values in the expression. AVG can be used
AVG(expression) with numeric fields only. Null values are ignored.

COUNT Returns the number of items in a group. Null values are not counted.
(expression)

MEDIAN Returns the median of an expression across all records. Median can only be
(expression) used with numeric fields. Null values are ignored.

STDEV Returns the statistical standard deviation of all values in the given
(expression) expression based on a sample of the population.

Tableau - Numeric Calculations:

This teaches how to apply numeric calculations to fields in Tableau, including subtracting values or
applying aggregate functions to a single field. Following are the steps to create a calculation field
and use numeric functions in it.

 Create Calculated Field:

While connected to Ecommerce_data, go to the Analysis menu and click ‘Create Calculated Field’, as
shown in the following screenshot.
 Calculation Editor:
The step prompts a calculation editor to display all available functions in Tableau, with the
dropdown value adjustable to display only numbers-related functions.

 Create a Formula:

To study the difference between profit and discount for different shipping mode of the products,
create a formula subtracting the discount from the profit as shown in the following screenshot.
Also, name this field as profit_n_discount.
 Using the Calculated Field:

The above calculated field can be used in the view by dragging it to the Rows shelf as shown in the
following screenshot. It produces a bar chart showing the difference between profit and discount
for different shipping modes.

 Applying Aggregate Calculations:

In a similar manner as above, we can create a calculated field using aggregate function. Here, create
AVG(sales) values for different ship mode. Write the formula in the calculation editor as shown in
the following screenshot.
On clicking OK and dragging the Avg_Sales field to the Rows shelf, we get the following view.

Tableau - Date Calculations:

Tableau offers numerous date functions for data analysis, allowing simple manipulations like
adding or subtracting days and creating complex expressions. To create a calculation field, follow
these steps.

Following are the steps to create a calculation field and use date functions in it.
 Create Calculated Field: While connected to Sample superstore, go to the Analysis menu
and click ‘Create Calculated Field’, as shown in the following screenshot.

 Calculation Editor: The above step opens a calculation editor, which lists all the functions
available in Tableau. We can change the dropdown value and see only the functions related
to Date.

 Create a Formula: Now, find out the sales volume along with the difference in the date of
sales in months from 21st March 2009. For this, create the formula as shown in the following
screenshot.
 Using the Calculated Field: Now to see the created field in action, we can drag it to the
Rows shelf and drag the Sales field to the Columns shelf. Also drag the ship Date with
months. The following screenshot shows the Sales values.

Tableau - Basic Sorting:


Sorting of data is a very important feature of data analysis. Tableau allows the sorting of data of the
fields, which are called dimensions. There are two ways in which Tableau carries out the sorting.

 Computed Sorting is a sort applied directly on an axis, selecting a field to sort and choosing
the sort order (ascending or descending).
 Manual sorting involves rearranging dimension fields by dragging them in an ad hoc
manner, altering the order visualization elements appear on the screen, allowing users to
choose their own sort order, not based on exact values.

Tableau - Basic Filters:


Tableau's filtering feature, which allows for simple scenarios and advanced calculations or context-
based filters, focusing on the basic filters available. There are three types of basic filters available in
Tableau. They are as follows −
 Filter Dimensions: These are the filters applied on the dimension fields. Typical examples
include filtering based on categories of text or numeric values with logical expressions
greater than or less than conditions.
Example
Ecommerce_ data source uses dimension filters to analyze product sub-categories, providing a
profit view based on shipping mode. To exclude categories, drag the dimension to Filters.

 Filter Measures: These are the filters applied on the measure fields. Filtering is based on
the calculations applied to the measure fields. Hence, while in dimension filters we use only
values to filter, in measures filter we use calculations based on fields.
Example
To apply dimension filters on average profit value, create a view with ship mode and subcategory
dimensions, drag AVG value to filter pane, choose Average mode, and filter rows.

After completion of the above steps, we get the final view below showing only the subcategories
whose average profit is greater than 20.

 Filter Dates: Tableau uses filter dates to apply relative, absolute, or range of dates to date
fields, presenting options when a date field is dragged out of the filter pane.
Example
Create a view with order date and profit in Ecommerce_data source, then filter the "order date"
field and select Range of dates in the filter dialog box.

On clicking OK, the final view appears showing the result for the chosen range of dates as seen in
the following screenshot.
Tableau - Context Filters:
Tableau's normal filters are independent, reading all rows from the source data and creating their
own results. However, dependent filters, which process only the records returned by the first filter,
can be used to improve performance and create a dependent numerical or top N filter, ensuring
queries are faster with large data sources.

 Creating Context Filter:


Using the Ecommerce_data, we find the top 10 Sub-Category of products for the category called
Furniture. To achieve this objective, we create a horizontal bar chart, to do this drag the dimension
Sub-Category to the Rows shelf and measure Sales to the Columns shelf. Right-click on the Sub-
Category field in the filter shelf, select Top, and choose Top 10 by Sales Sum. Select Furniture from
the list and right-click to edit. Add the Furniture filter to the context to display the top 10
subcategories.

Tableau - Condition Filters:

Tableau offers filtering options by applying conditions to existing filters, ranging from simple to
complex, and creating range filters based on specific formulas.

 Creating a Condition Filter:

Using the Ecommere_data, we find that sub-category of products across all segments whose sales
exceed one million. To achieve this objective, we create a sales chart, to do this drag the dimension
segment and measure Sales to the Column shelf, then to the Rows shelf, and select a horizontal bar
chart option. Edit the condition by selecting Sales, Sum, and greater than equal symbol.

After completing the two steps, a chart is generated displaying only subcategories with the required
sales amount, and all available segments where the condition is met.
Tableau - Top Filters:

The Top option in Tableau filters can be used to limit the result set, such as focusing on the top 10
sales records, using built-in options or formulas.

 Creating a Top Filter:

Using the Sample-superstore, find the sub-category of products which represents the top 5 sales
amount. To achieve this objective, we drag the dimension Sub-Category to the Rows shelf and
Measure Sales to the Columns shelf, choose horizontal bar as chart type, and right-click on Top.

After completing the given step, we will receive a chart displaying the top 5 sub-categories of
products by sales.
Tableau - Filter Operations:

This covers data analysis and visualization using Tableau's filtering options, including numeric
calculations and comparisons for measures and string values for dimensions. It covers various
options, editing steps, and clearing filters.

 Creating Filters:

Create filters by dragging fields to the Filters shelf, create horizontal bar charts with measure sales
and dimension sub-category, and edit filters by right-clicking and selecting the edit filter option.

 Creating Filters for Measures:

Measures are numeric fields. So, the filter options for such fields involve choosing values. Tableau
offers the following types of filters for measures.

 Range of Values − Specifies the minimum and maximum values of the range to include in
the view.
 At Least − Includes all values that are greater than or equal to a specified minimum value.
 At Most − Includes all values that are less than or equal to a specified maximum value.
 Special − Helps we filter on Null values. Include only Null values, Non-null values, or All
Values.

Following worksheet shows these options.


 Creating Filters for Dimensions:

Dimensions are descriptive fields having values which are strings. Tableau offers the following
types of filters for dimensions.

 General Filter − allows to select specific values from a list.


 Wildcard Filter − allows to mention wildcards like cha* to filter all string values starting
with cha.
 Condition Filter − applies conditions such as sum of sales.
 Top Filter − chooses the records representing a range of top values.

Following worksheet shows these options.


Tableau - Bar Chart:
A bar chart in Tableau is a data visualization tool that displays data in rectangular bars proportional
to the variable's value. It can be created by dragging dimensions to the Row and Column shelves.

 Simple Bar Chart:

Select dimension, profit, and sub-category from Sample-Superstore, and a horizontal bar chart will
be generated. If not, choose a different chart type from the Show Me tool.

 Bar Chart with Color Range:

To apply colors to bars based on their ranges, drag the profit field to the color palette under the
Marks Pane, and note that negative bars produce different colors.
 Stacked Bar Chart:
We can add another dimension to the above bar chart to produce a stacked bar chart, which shows
different colors in each bar. Drag the dimension field named segment to the Marks pane and drop it
in colors. The following chart appears which shows the distribution of each segment in each bar.

Tableau - Line Chart:

A line chart is a visual representation of a relationship between a measure and a dimension, created
by joining points along two axes. A simple line chart is created as follows by selecting Ship Mode
and Sales.
Maps in Tableau:

Maps are an effective way to represent data in Tableau, providing an attractive, easy-to-infer option
and making it highly interactive for plotting demographic or geographical data.

A basic map for the United States in Tableau is as shown below:

Reference line in Tableau:

A reference line is a line drawn using an aggregate function on a visualization for further analysis
and highlighting important parts..

The following visualization depicts the reference line being drawn for Average Sales for the
Ecommerce_data with the graph attributes as Order Date(YEAR wise and QUARTER wise) and
Sales.
Trend Lines in Tableau:

Trend line is defined as the line that connects two or more points and extends the line on the basis
of these points. This is used to describe important information and most importantly for analysis.

A simple example for trend line is depicted as follows:

Tableau - Clustering:

Cluster analysis or clustering in Tableau is dividing a data set into segments or clusters having
relevant data values. Clustering helps us conduct a comparative analysis of data in Tableau. A
cluster contains similar data values of a dimension that is the values in a cluster are more related to
each other than the data in other clusters. Thus, clustering is done using specific clustering
algorithms where similar values are kept together as a part of the group. In Tableau, we can have a
cluster of up to seven color shades or codes at a time.

For instance, if we have sales data for a product for different types of consumers or buyers. Now, we
want to analyze the purchasing capacity or trends of consumers. For this, we can create clusters
where we can segregate consumers based on their purchasing capacities. Now that we are able to
unveil and analyze consumer’s purchasing or spending capacities, we can come up with strategies
to maximize sales.

A simple example depicting clustering in Tableau is as shown below. Here, a scatter plot is created
between profit and sakes values. Since, we set the Number of Clusters value as 4, therefore, it shows
four clusters as Cluster 1, Cluster 2, Cluster 3 and Cluster 4 with each cluster corresponding to
different colors as specified by the legend located in the extreme top-right corner.
Tableau – Dashboard:

A dashboard is a consolidated display of worksheets and related information, used to compare and
monitor data simultaneously. It is displayed as tabs at the bottom of the workbook and updated
with the latest data. Each view is connected to its corresponding worksheet, ensuring seamless
updates.

An example for a dashboard is as follows:


Tableau – Forecasting:

Forecasting is about predicting the future value of a measure. There are many mathematical models
for forecasting. Tableau uses the model known as exponential smoothing. In exponential
smoothing, recent observations are given relatively more weight than older observations. These
models capture the evolving trend or seasonality of the data and extrapolate them into the future.
The result of a forecast can also become a field in the visualization created.

Tableau takes a time dimension and a measure field to create a forecast.

 Creating a Forecast:

To forecast Ecommerce sales for next year, create a line chart with Order Date and Sales columns,
click Forecast under Model category, set Forecast Length as 2 years, and leave Forecast Model to
Automatic. Click OK to get the final forecast result.

Hierarchy in Tableau:

Hierarchy is tree-like structure that represents the level-wise configuration. In Tableau, the data
with relation can be used to form a hierarchy. Similar and related data are grouped in the form of a
hierarchical structure to do further operations.
Steps to create Hierarchy

 Connect to Sample Superstore data


 In the Data pane, drag a Region, and drop it directly to Country
 Create Hierarchy dialog box will appear
 Change Name to Geographical Location

 In the data pane, a new hierarchy is created, as seen below:

 Drag and Drop State, City, Postal Code to Geographical Location


 Re-order fields in the Hierarchy to the required positions
Tableau Action Filter:

Tableau is a visual analytics solution that enables users to explore and analyze data through simple
drag-and-drop operations. Data growth has been rapid in recent years, and in order to realize the
true potential of this data, it is necessary to visualize it, which is where Tableau will assist us.

Tableau Action Filter is used to transfer data between worksheets. Typically, a filter Tableau action
sends information from a selected mark to another sheet that displays the related data.

Highlight Actions in Tableau:

Leveraging various attributes like color, shape, orientation etc. is a crucial part in designing
dashboards. It reduces the cognitive load and brings important trends and data points to the
attention of the viewer. Tableau has a remarkable feature known as highlight dashboard actions
that focuses on making data exploration more efficient and bringing data points of interest into the
spotlight of the viewer. The data labels and reference lines can also be configured to work in
coordination with highlight actions as they are triggered. Being familiar with this feature will
definitely help you improve the level of interactivity and data exploration in your dashboards.

Conclusion:

We successfully learned the basics of Tableau. Tableau is a great visualization tool in which lays the
foundation for a comprehensive journey into the world of data visualization and analysis.
Experiment - 2
Aim: Using Ecommerce Data, display profit based on market and explain which market is having
highest profit and lowest profit.

Tools Required: Tableau Desktop

Dataset Used: The dataset used in this practical is Ecommerce_data.xslx. E-commerce is rapidly
gaining popularity as businesses increasingly utilize web sites for online transactions, making
shopping a common practice.

This dataset covers Orders data for various Product Categories. Within this file we will find the
following fields:

Field Description
Order ID Unique Order ID of a product
Order Date Order Placement Date
Ship Date Shipment Date of the placed order
Aging Used to Create Histogram Bin
Ship Mode Shipment mode of placed order
Product Category Product Category
Product Name of the Product
Sales Sales Amount
Quantity The amount or number of a material
Discount A deduction from the usual cost of something
Profit Obtain a financial advantage or benefit
Shipping Cost The amount required to ship the placed order
Order Priority Precedence of placed order
Customer Id Unique Customer ID
Customer Name Name of the Customer
Segment Product Segment (i.e., Home
Office/Corporate/Consumer etc.)
City Unique City Name
State Unique State Name
Country Unique Country Name
Region Especially the part of a country
Months The month of placing the order

Procedure:

1. Open Tableau Desktop. Go to the Connect panel at the left side of the start page, click the
Excel link under the To a File heading to open file selection option.
2. Open Excel worksheet Ecommerce_data.xlsx by selecting it and clicking Open.
3. Select the Orders sheet from the navigation menu on the left and drag it onto the Drag
Sheets Here area.
4. After loading the data, we can perform data cleaning, data preparation and feature
extraction to some extent.
5. Open a new worksheet.
6. From the Data pane, drag Market to the Columns shelf.
7. From the Data pane, drag Profit to the Rows shelf.
8. Tableau generates a bar graph as shown in the screenshot with profit rolled up as sum
(aggregated). We can see total aggregated profit for each market.
9. To refine our view further, we will drag Profit to Label on the Marks card on the Data
pane.
10. Now, the corresponding profit values with respect to each market will be displayed.

Output:

Conclusion:

We have successfully displayed the profit based on market using Ecommerce Data in Tableau.

As it is clearly visible from the bar graph (as shown in the screenshot), Europe earns the highest
profit ($449.552) among five markets, while Africa earns the lowest profit ($88,872).
Experiment - 3
Aim: using Ecommerce Data, display monthly sales across all the years.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Sales to the Rows shelf.
6. Drag Order Date to Columns and drill down by Year from the Data pane.
7. Drag Order Date to Columns and drill down by Month from the Data pane.
8. On the Marks card, change the graph type to Bar.
9. We will further refine our view. Press CTRL and drag YEAR (Order Date) on Columns to
Color.
10. Also, drag Sales to Label on the Marks card.
11. Tableau generates a grouped bar graph displaying the monthly sales across all the years
with a color legend in the top-right corner of the sheet where different colors correspond
to different years.

Output:

Conclusion:

We have successfully displayed monthly sales across all the years using Ecommerce Data using
Tableau.
Experiment - 4
Aim: Using Ecommerce Data, display sales and profit based on category and subcategory. Sort it
based on profit using fields in descending order.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Category and Sub-Category to the Rows shelf.
6. From the Data pane, drag Sales and Profit to the Columns shelf.
7. A grouped bar graph is obtained. Now, go to Category on the Rows shelf, right-click on it
and select the Sort... option from the context menu.
8. In the Sort dialog, select the Descending option.
9. Select Sort By Field and choose the field name from the drop-down list as Profit based on
sum.
10. Repeat the steps 7 to 9 for Sub-Category as well.
11. For further refining our view, in the Marks card, go to SUM (Sales) and drag Sales to
Label.
12. Again, in the Marks card, go to SUM (Profit) and drag Profit to Label.
13. Tableau generates a grouped bar graph with sales and profit based on category and
subcategory in descending order of profit with the respective sales and profit labeled across
each of the bars.

Output:

Conclusion:

We have successfully displayed sales and profit based on category and subcategory of Ecommerce
Data in descending order of profit using Tableau.
Experiment - 5
Aim: Create a view to display average sales based on segment using Ecommerce Data. Also
comment on which segment is giving highest average sales.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Segment to the Columns shelf.
6. From the Data pane, drag Sales to the Rows shelf.
7. Right-click on the Sales in the Rows shelf, go to Measure and select Average.
8. A simple bar graph is obtained. To further refine our view, go to the Marks card, and drag
Sales to Label.
9. Right-click on the SUM (Sales) in the Marks card, go to Measure and select Average.
10. Tableau generates a bar graph displaying average sales based on segment with the average
sales labeled across each bar segment.

Output:

Conclusion:

We have successfully displayed average sales based on segment using Ecommerce Data with the
help of Tableau.

As it can clearly be seen from the screenshot, the Corporate segment has the highest average
sales value, around $247.890 among the three segments present in the Ecommerce Dataset.
Experiment - 6
Aim: Using Ecommerce Data, display sales and profit based on ship mode and mention which one is
having highest profit and highest sales.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it and
clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Profit and Sales to the Columns shelf.
6. From the Data pane, drag Ship Mode to the Rows shelf.
7. Go to the Marks card, and drag Profit to Color.
8. For further refining our view, in the Marks card, go to SUM (Profit) and drag Profit to
Label.
9. Again, in the Marks card, go to SUM (Sales) and drag Sales to Label.
10. Tableau generates a grouped bar graph with profit and sales labeled across each bar based
on ship mode with profit in color mode.

Output:

Conclusion:

We have successfully displayed sales and profit based on ship mode using Ecommerce Data with
the help of Tableau.

As it is clearly visible from the screenshot, the Standard Class ship mode has the highest profit
($890,596) as well as the highest sales ($7,578,652). Hence, it can be concluded that the
Standard Class generates the maximum profit and sales among all the ship modes present in the
Ecommerce Dataset.
Experiment - 7
Aim: Display states of the United States with different colors and names using Ecommerce Data.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. In the Data pane, right-click the geographic field, Country, and then select Hierarchy >
Create Hierarchy.
6. In the Create Hierarchy dialog box that opens, give the hierarchy a name, such as Mapping
Items, and then click OK.
7. The Mapping Items hierarchy is created with the Country field.
8. In the Data pane, drag the State field to the hierarchy and place it below the Country field.
9. Repeat the above step for the City and Postal Code fields.
10. When you are finished, your hierarchy should be in the following order:
 Country
 State
 City
 Postal Code
11. From the Data pane, drag Country to Filters. In General, under List, from the drop-down
select Select from list.
12. Now search for the United States. Select its check box and click OK.
13. In the Data pane, double-click Country. The Country field is added to Detail on the Marks
card, and Latitude (generated) and Longitude (generated) are added to the Columns
and Rows shelves.
14. A map of the United Sates is obtained.
15. On the Marks card, click the + icon on the Country field. The State field is added to Detail
on the Marks card and the map updates to include a data point for every state in the data
source.
16. Again, on the Marks card, click the Mark Type drop-down and select Map. The map updates
to a polygon map.
17. Click on the detail symbol in front of the State field and select Label. Each state is labeled
with its name.
18. Now, drag State from the Data pane to Color on the Marks card.
19. Tableau generates a map of the United States with each of the state as labeled with their
names having different colors. A legend is created as well which maps the different colors to
their corresponding states.
Output:

Conclusion:

Thus, we have successfully displayed states of the United States with different colors and names
using Ecommerce Data in Tableau.
Experiment - 8
Aim: Draw category-wise, market-wise, segment-wise and sub-category-wise trend line for sales
and profit using Ecommerce Data.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Sales to the Columns shelf.
6. From the Data pane, drag Profit to the Rows shelf.
7. From the Data pane, drag Category to Detail in the Marks card.
8. Repeat the above step for Market, Segment and Sub-Category fields as well.
9. Select the Analytics pane.
10. From the Analytics pane, drag Trend Line into the view, and then drop it on the Linear,
model type.
11. Tableau generates a Linear Trend Line for sales and profit category-wise, market-wise,
segment-wise and sub-category-wise.
12. Choose from various Trend Line model types, including Logarithmic, Exponential,
Polynomial, or Power as per your data and requirement.

Output:

Conclusion:

Thus, we have successfully drawn category-wise, market-wise, segment-wise and sub-category-


wise trend line for sales and profit using Ecommerce Data in Tableau.
Experiment - 9
Aim: Display month-wise profit forecasting using Ecommerce Data (Study forecasting option in
detail).

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Profit to the Rows shelf.
6. Drag Order Date to Columns and drill down by Year from the Data pane.
7. Drag Order Date to Columns and drill down by Month from the Data pane.
8. Right-click on the view, select Forecast and click on Show Forecast.
9. We will get the final forecast result as shown in the output screenshot.

Output:

Conclusion:

Thus, we have successfully displayed the month-wise profit forecasting using Ecommerce Data in
Tableau.
Experiment - 10
Aim: Draw reference line for sales (150K) category-wise and market-wise using Ecommerce Data.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Category and Market to the Columns shelf.
6. From the Data pane, drag Sales to the Rows shelf.
7. Also, drag Sales to Label in the Marks card.
8. Now right-click on the vertical axis and select Add Reference Line.
9. Scope as Table.
10. Under Line, in Value, set the value as 150,000 and set the Computation to Constant.
11. Under Line Label, set it to Custom with 150,000 as text.
12. Click close ( ) when done.
13. A reference line for sales (150K) category-wise and market-wise is obtained.

Output:

Conclusion:

Thus, we have successfully drawn the reference line for sales (150K) category-wise and market-
wise using Ecommerce Data in Tableau.
Experiment - 11
Aim: Display category-wise high profit and low profit groups (Use Create Parameters and Create
Computed Field options) profit using Ecommerce Data.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.
5. From the Data pane, drag Category to the Columns shelf.
6. From the Data pane, drag Profit to the Rows shelf.
7. In the Data pane, click the drop-down arrow in the upper right corner and select Create
Parameter.
8. In the Create Parameter dialog box, give the field a Name, say Threshold.
9. Specify the data type for the values it will accept, here it will be Integer.
10. Specify a current value. This is the default value for the parameter. In this case, let’s set it
as 300,000.
11. Let the Allowable values be All.
12. When finished, click OK.
The parameter is now listed in the Parameters section at the bottom of the Data pane.
13. Now, select Analysis > Create Calculated Field.
14. In the Calculation Editor that opens, give the calculated field a name. In this case, the
calculated field is called High_Low_Profit Group.
15. In the Calculation Editor, enter a formula. This case uses the following formula:
IF SUM ([Profit]) >= ([Threshold])
THEN "High Profit Group"
ELSE "Low Profit Group"
END
16. When finished, click OK. The new calculated field is added to the Data pane.
Since the new field computes quantitative data, it is added to Measures.
17. Now, right-click the parameter in the Data pane and select Show Parameter.
Since this is a dynamic parameter, we can change the parameter value as desired by typing
the value in the Parameter Control.
18. From the Data pane, drag High_Low_Profit Group to Color in the Marks card.
19. From the Data pane, drag Profit to Label in the Marks card to further refine our view.
20. Category-wise high profit and low profit groups are displayed.
Output:

Conclusion:

Thus, we have successfully displayed the category-wise high profit and low profit groups using
Ecommerce Data in Tableau.
Experiment - 12
Aim: Design a dashboard which displays market-wise, category-wise, sales and profit on different
sheets using filled map (Country, State and Market). Use Action on filter, Highlight.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet and rename it as MC-Sales.
5. Give a title to the view, say Market-wise Sales.
6. From the Data pane, drag Market to the Columns shelf.
7. From the Data pane, drag Sales to the Rows shelf.
8. To refine our view further, we will drag Sales to Label on the Marks card on the Data
pane.
9. Tableau generates a bar graph where sales are rolled up as sum (aggregated) and the sales
for each market is labeled.
10. Now, open another new worksheet, rename it as MC-Profit.
11. Give a title to the view, say Market-wise Profit and repeat the steps 6 to 9 for the Profit
field.
12. A bar graph where profit is rolled up as sum (aggregated) is obtained and the profit for each
market is labeled.
13. Again, open a new worksheet and rename it as PCM-Sales Map.
14. Give a title to the view, say Category-Market-wise Sales Filled Map.
20. In the Data pane, right-click the geographic field, Country, and then select Hierarchy >
Create Hierarchy.
21. In the Create Hierarchy dialog box that opens, give the hierarchy a name, such as Mapping
Items, and then click OK. The Mapping Items hierarchy is created with the Country field.
22. In the Data pane, drag the State field to the hierarchy and place it below the Country field.
23. Repeat the above step for the City and Postal Code fields.
24. When you are finished, your hierarchy should be in the following order:
 Country
 State
 City
 Postal Code
25. In the Data pane, double-click Country. The Country field is added to Detail on the Marks
card, and Latitude (generated) and Longitude (generated) are added to the Columns
and Rows shelves.
26. On the Marks card, click the + icon on the Country field. The State field is added to Detail
on the Marks card and the map updates to include a data point for every state in the data
source.
27. Again, on the Marks card, click the Mark Type drop-down and select Map. The map
updates to a polygon map.
28. Now, drag Category and Market fields from the Data pane to Detail on the Marks card.
29. Drag Sales from Data pane to Color in the Marks card.
30. A filled map of category-wise sales for Country, State and Market is obtained.
31. Open another new worksheet and rename it as PCM-Profit Map.
32. Give a title to the view, say Category-Market-wise Profit Filled Map and repeat the steps
from 25 to 29 for the Profit field.
33. A filled map of category-wise profit for Country, State and Market is obtained.
34. Hence, we have now created 4 worksheets MC-Sales, MC-Profit, PCM-Sales and PCM-
Profit. All these sheets will be used further for designing a dashboard.

Output:
 MC-Sales

 MC-Profit
 PCM-Sale Map

 PCM-Profit Map

Designing a Dashboard
1. At the bottom of the workbook, click the New Dashboard icon:

2. From the Sheets list at left, drag sheets MC-Sales, MC-Profit, PCM-Sales Map and PCM-
Profit Map to your dashboard at right.
3. Adjust the sheets accordingly in the dashboard to make it more presentable and
understandable.
Output:

Using Action on Filter

1. Select Dashboard > Actions from a dashboard.


2. Click Add Action in the Actions dialogue box
3. Then select Filter.
4. Give the action a unique Name, say Find World Market.
5. Let the data source be Dashboard. Choose the Source Sheets as MC-Profit.
6. Specify Run action on as Select.
7. Again, let the data source be Dashboard. Choose the Target Sheets as PCM-Profit Map.
8. Specify Clearing the selection will as Show All Values.
9. Under Filter, select All Fields.
10. When finished, click OK.
11. Now, if we select and any markets in the MC-Profit sheet say USCA, it shows all the details
of that market such as Category, Country, State and Profit in the PCM-Profit Map sheet.
Output:

Using Action on Highlight

1. Select Dashboard > Actions from a dashboard.


2. Click Add Action in the Actions dialogue box
3. Then select Highlight.
4. Give the action a unique Name, say Highlight World Market.
5. Let the data source be Dashboard. Choose the Source Sheets as MC-Sales.
6. Specify Run action on as Select.
7. Again, let the data source be Dashboard. Choose the Target Sheets as PCM-Sales Map.
8. Under Target Highlighting, select All Fields.
9. When finished, click OK.
10. Now, if we select and any markets in the MC-Sales sheet say USCA, it shows all the details of
that market such as Category, Country, Market, State and Sales in the PCM-Sales Map sheet.

Output:

Conclusion:
Thus, we have successfully designed a dashboard which displays market-wise and category-wise,
sales and profit on different sheets using filled map for Country, State and Market using Ecommerce
Data. We also successfully implemented the Action on Filter and Highlight options on the dashboard
for further interactivity with the data and the visualizations in Tableau.
Experiment - 13
Aim: Display category-wise high profit and low profit groups (Use Create Parameters and Create
Computed Field options) profit using Ecommerce Data.

Tools Required: Tableau Desktop

Procedure:

1. Open Tableau Desktop by clicking the icon in the Start menu.


2. Click the Excel link in the Connect panel and open Ecommerce_data.xlsx by selecting it
and clicking Open to open file selection option.
3. Drag the Orders sheet from the navigation menu onto the Drag Sheets Here area.
4. After extraction, open a new worksheet.

You might also like