Business Practicals
Business Practicals
Business Practicals
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 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.
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.
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.
Tableau offers filtering options by applying conditions to existing filters, ranging from simple to
complex, and creating range filters based on specific formulas.
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.
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.
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.
Dimensions are descriptive fields having values which are strings. Tableau offers the following
types of filters for dimensions.
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.
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.
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 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.
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.
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.
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
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.
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.
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.
Procedure:
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.
Procedure:
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.
Procedure:
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.
Procedure:
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.
Procedure:
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.
Procedure:
Output:
Conclusion:
Procedure:
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.
Procedure:
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.
Procedure:
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.
Procedure:
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:
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.
Procedure: