4 - Data Manipulations
4 - Data Manipulations
Business Scenario
CEO of a Telecom Company wants to analyze their customer data from various perspectives like, by
region, time, age group, etc. Being a data manager, you are asked to create multiple views for customer
data analysis using Tableau Desktop. In this case you can create multiple views by sorting the customer
data by age group, by applying filters on the regions, by adding calculated sets to find top 5 customers,
by creating groups of regions by state, etc.
Overview
In this exercise you will perform sorting by various methods:
Create a view that displays the discount data for all the categories and across all the years.
Sort this data in descending order for year 2013 using Sort icon.
Clear the applied sort.
Once again apply sorting using Sort [Year of Order Date] window, so as to determine which
products and years have the highest average discounts.
Save workbook as Yearly Category Discount View.
Note: You will perform this exercise using Tableau’s sample data source, Sample – Superstore -English
(Extract).
Detailed Instructions
Create View
1. On the Home page, under Saved data sources, click Sample - Superstore - English - (Extract).
2. In the Data pane, under Dimensions, locate and drag Order Date to the Columns shelf.
3. In the Data pane, under Dimensions, locate and drag Category to the Rows shelf.
4. In the data pane, under Measures, locate and drag Discount to the Text in the Marks card.
5. To sort 2013 data in descending order, hover your mouse over 2013 header and click the sort
icon as shown below:
Clear Sorting
6. To clear the sorting, hover over 2013 header and click the sort icon twice.
On the first click, the sorting order is changed from descending to ascending, while on the
second click the sorting is removed.
7. In the Columns shelf, click the YEAR(Order Date) drop-down and select Sort.
8. In the Sort [Year of Order Date] window, under Sort Order, click Descending.
9. In the Sort [Year of Order Date] window, under Sort By, click Field.
10. In the Field drop-down list, select Discount if not already selected.
11. In the Aggregation drop-down list, select Average if not already selected.
Overview
In this exercise, you will create a view to analyze sales for each category:
Create a group such that Envelops, Labels, and Paper are displayed as a single member.
Rename the new group created using Edit Alias.
Observe the combined sales value for this newly created group in the tooltip.
Note: You will perform this exercise using Tableau’s sample data source, Sample – Superstore -English
(Extract).
After grouping the members, the view should resemble the following image:
Detailed Instructions
Create View
1. On the Home page, under Saved data sources, click Sample- Superstore - English (Extract).
2. In the Data pane, under Dimensions, locate and drag Category to the Rows shelf.
3. In the Data pane, under Measures, locate and drag Sales to the Columns shelf.
Save Workbook
Create Group
6. In the view area, holding CTRL key, select Envelopes, Labels and Paper categories.
7. To create a group, click the paper clip icon on the toolbar and select Category as shown in the
image below:
Alias
8. To create an alias for the Envelopes, Labels, Paper group, right-click the name of the group in
the view, and select Edit Alias as shown in the image below:
Observe Tooltip
11. To view the tooltip, hover over the newly created group mark.
12. Observe the combined sales figure in the tooltip for Paper Products is now $1,353,181.
(Note: Do not save the changes in Category Sales View and close Tableau)
Overview
In this exercise you will:
Use the Category Sales View workbook.
Create a set for Chairs & Chairmats, Office Machines, Tables, and Telephones and
Communication categories.
Apply this set to the category sales view and observe the change in color for categories that are
part of the set and the ones that are excluded.
Alter this view such that only the members in the set are displayed.
Detailed Instructions
1. On the File menu, click Open.
2. In the Open window, select Category Sales View.
3. Click Open.
Create Set
4. Select the mark corresponding to Chairs & Chairmats holding the CTRL key select the marks
corresponding to the Office Machines, Tables, and Telephone and Communication.
5. Right-click on any of the selected marks and select Create Set as shown below:
6. In the Create Set window, in the Name box, type High Performing Categories as shown below:
7. Click OK.
Apply Set
8. In the Data pane, under Sets, drag the High Performing Categories set to the view area.
Note: Observe the marks for categories that are part of the set are in color blue, while the rest
are in color grey.
9. To display only the members that are part of the set, in the Marks card, click the IN/OUT (High
Performing Categories) drop-down and select Show Members in Set.
Overview
In this exercise, you will use the Category Sales View and apply filters by various methods:
Apply a filter on the sales header so that only categories having sales above $1000000 are
displayed. Click Undo to return to the previous view.
Drag and drop the Category measure to the Filters shelf and set the filtering so that the view
displays data only for Bookcases, Envelopes, Paper, and Label categories only. Edit the filter so
that all the categories are displayed.
Edit the Category filter so as to display categories starting with ‘C’
Use the Exclude feature to remove the mark for Chairs & Chairmats category.
You will apply a quick filter to display sales data for categories starting with S.
Change the quick filter display type to Multiple Values (dropdown) and display data for all
categories except Rubber Bands and Paper.
Detailed Instructions
1. On the File menu, select Open.
2. In the Open window, select Category Sales View.
3. Click Open.
4. In the Columns shelf, click the SUM(Sales) dropdown and select Filter.
5. In the Filter [Sales] widow, click At least.
7. Click OK.
Observe that only categories having sales greater than $1000000 are displayed as shown below:
9. In the Data pane, under Dimensions, locate and drag Category to the Filters shelf.
10. In the Filter [Category] window, under Select from list, clear the Bookcases, Envelopes, Paper,
and Labels checkbox.
11. Select the Exclude checkbox as shown below:
Observe that the view displays sales only for Bookcases, Envelopes, Paper, and Labels categories as
shown below:
13. To edit the filter, in the Filters shelf, click the Category dropdown and select Filters.
14. In the Filter [Category] window, under Select from list click All.
15. Clear the Exclude checkbox.
16. Click OK.
17. In the Filters shelf, click the Category dropdown and select Filters.
18. In the Filter [Category] window, click the Wildcard tab.
19. On the Wildcard tab, in the Match value box, type C.
22. Hover over the mark for the Chairs & Chairmats category such that the tooltip is displayed.
23. In the tooltip, click Exclude.
This will exclude the mark for Chairs & Chairmats and display data only for Computer Peripherals
and Copiers and Faxes categories as shown below:
24. In the Filters shelf, click the Category drop down and select Show Quick Filter.
Note: Observe that the data is displayed only for categories starting with S.
27. Click the Category quick filter drop-down and select Multiple Values (Dropdown).
Overview
Detailed Instructions
Create View
1. On the Home page, under Saved data sources, click Sample-Superstore - English (Extract).
2. In the Data pane, under Dimensions, locate and drag Order Date to the Columns shelf.
3. In the Data pane, under Measures, locate and drag Sales to the Rows shelf.
4. To color code the view at quarter level, in the Data pane, under Dimensions, drag Order Date to
the Color in the Marks card.
5. In the Marks card, click the Year(Order Date) drop-down and select Quarter.
6. To change the order date level, in the Columns shelf, click the Year(Order Date) drop-down and
select Day.
Overview
In this exercise you will:
Create and apply a computed set that includes only the top five categories based on their sales.
Create a category sales report and use this set to highlight the top five performing categories.
Note: You will perform this exercise using Tableau’s sample data source, Sample – Superstore -English
(Extract).
Detailed Instructions
Create View
1. On the Home page, under Saved data sources, Sample -Superstore -English (Extract).
2. In the Data pane, under Measures, locate and drag Sales to the Columns shelf.
3. In the Data pane, under Dimensions, locate and drag Category to the Rows shelf.
4. In the Data pane, under Dimensions, select Category.
6. In the Create Set window, in the Name box type Top 5 Categories.
7. On the General tab, click Use all.