Data Visulaization R Programming Manual
Data Visulaization R Programming Manual
LAB MANUAL
INDEX
S.NO NAME OF PROGRAM
1 Vision and Mission of Institution and Department
2 COs, POs, PSOs & PEOs
3 Syllabus
4 List of Experiments
5 Programs
6 Content Beyond Syllabus
St. MARTIN’S ENGINEERING COLLEGE
UGC Autonomous
NBA & NAAC A+ Accredited
Dhulapally, Secunderabad – 500100
www.smec.ac.in
Vision of the innovating engineering and management professionals who would take
Institute the world into their stride through sustainable growth in technology and
management.
COURSE OBJECTIVES
S. NO. Course Objectives
COURSE OUTCOMES
CO. NO. Course Outcomes BTL
Understand How to import data into Tableau.
CO1 BTL-1
Understand Tableau concepts of Dimensions and Measures.
CO2 BTL-2
Develop Programs and understand how to map Visual Layouts and
C03 Graphical Properties. BTL-3
Create a Dashboard that links multiple visualizations.
C04 BTL-4
Use graphical user interfaces to create Frames for providing
C05 solutions to real world problems BTL-5
St. MARTIN’S ENGINEERING COLLEGE
UGC Autonomous
NBA & NAAC A+ Accredited
Dhulapally, Secunderabad – 500100
www.smec.ac.in
PROGRAM OUTCOMES
S. NO. Program Outcomes Level Expertise
Assessed by
Engineering knowledge: Apply the knowledge of
PO1 mathematics, science, engineering fundamentals, and an 3 Assignments
engineering specialization to the solution of complex
engineering problems.
Problem analysis: Identify, formulate, review research
PO2 literature, and analyze complex engineering problems 3 Assignments
reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
Design/development of solutions: Design solutions for
complex engineering problems and design system
PO3 components or processes that meet the specified needs 3 Mini Projects
with appropriate consideration for the public health and
safety, and the cultural, societal, and environmental
considerations.
Conduct investigations of complex problems: Use
research-based knowledge and research methods
PO4 including design of experiments, analysis and 3 Projects
interpretation of data, and synthesis of the information to
provide valid conclusions.
Modern tool usage: Create, select, and apply appropriate
techniques, resources, and modern engineering and IT
PO5 tools including prediction and modeling to complex 2 Mini Projects
engineering activities with an understanding of the
limitations.
The engineer and society: Apply reasoning informed by
the contextual knowledge to assess societal, health, safety,
PO6 legal and cultural issues and the consequent 1 --
responsibilities relevant to the professional engineering
practice.
Environment and sustainability: Understand the impact
PO7 of the professional engineering solutions in societal and 1 --
environmental contexts, and demonstrate the knowledge
of, and need for sustainable development.
Ethics: Apply ethical principles and commit to
PO8 professional ethics and responsibilities and norms of the 2 --
engineering practice.
Individual and team work: Function effectively as an
PO9 individual, and as a member or leader in diverse teams, 1 --
and in multidisciplinary settings
Communication: Communicate effectively on complex
engineering activities with the engineering community
PO10 and with society at large, such as, being able to 1 --
comprehend and write effective reports and design
documentation, make effective presentations, and give and
receive clear instructions.
Life-long learning: Recognize the need for, and have the
PO11 preparation and ability to engage in independent and life- 1 --
long learning in the broadest context of technological
change.
Project management and finance: Demonstrate
knowledge and understanding of the engineering and
PO12 management principles and apply these to one’s own 2 Projects
work, as a member and leader in a team, to manage
projects and in multidisciplinary environments
1- None 2- Supportive 3- Highly Related
St. MARTIN’S ENGINEERING COLLEGE
UGC Autonomous
NBA & NAAC A+ Accredited
Dhulapally, Secunderabad – 500100
www.smec.ac.in
PSO Proficiency
Program Specific Outcomes Level
No. Assessed by
1. Understanding Data, What is data, where to find data, Foundations for building Data
Visualizations, Creating Your First visualization?
2. Getting started with Tableau Software using Data file formats, connecting your Data
to Tableau, creating basic charts(line, bar charts, Tree maps),Using the Show me
panel.
3. Tableau Calculations, Overview of SUM, AVR, and Aggregate features, Creating
custom calculations and fields.
4. Applying new data calculations to your visualizations, Formatting Visualizations,
Formatting Tools and Menus, Formatting specific parts of the view.
5. Editing and Formatting Axes, Manipulating Data in Tableau data, Pivoting Tableau
data.
6. Structuring your data, Sorting and filtering Tableau data, Pivoting Tableau data.
7. Advanced Visualization Tools: Using Filters, Using the Detail panel, using the Size
panels, customizing filters, Using and Customizing tooltips, Formatting your data
with colors.
8. Creating Dashboards & Storytelling, creating your first dashboard and Story,
Design for different displays, adding interactivity to your Dashboard, Distributing
& Publishing your Visualization.
9. Tableau file types, publishing to Tableau Online, Sharing your visualizations,
printing, and Exporting.
10. Creating custom charts, cyclical data and circular area charts, Dual Axis charts.
TEXT BOOKS
1. Thomas Rahlf. Data Visualisation with R. Springer International Publishing, New York,
2017. ISBN 978-3-319-49750-1.
2. Lawrence Leemis. Learning Base R. Lightning Source, 2016. ISBN 978-0-9829174-80
3.
REFERENCE BOOKS
E -TEXT BOOKS
MOOCS COURSES
. 1 Understanding Data, What is data, where to find data, Foundations for building
Data Visualizations, Creating Your First visualization?
When you first connect to a data source, such as the Superstore file, Tableau will display the
data connection and the fields in the data pane on the left sidebar. Fields can be dragged
from the data pane onto the canvas area or onto various shelves, such
as Rows, Columns, Color, or Size. We'll see that, placement of the fields will result in
different encodings of the data, based on the type of field.
The Sales field is used as a measure in this view. Specifically, it is being aggregated as a sum.
When you use a field as a measure in the view, the type aggregation (such
as SUM, MIN, MAX, AVG) will be shown on the active field. In the preceding example, the
active field on Rows clearly indicates the sum aggregation of Sales: SUM(Sales).
The Region field is a dimension with one of four values for each record of
data: Central, East, South, or West. When the field is used as a dimension in the view, it
slices the measure. So instead of an overall sum of sales, the preceding view shows the sum
of sales for each region.
Oracle Analytics to create a dataset. The dataset provides the data for creating visualizations.
1. Sign in to Oracle Analytics.
2. On the Home page, click Create, and then click Dataset.
3. In Create Dataset, click Drop data file here or click to browse. In File Upload,
click sample_revenue.xlsx, and then click Open.
Once you’ve installed Tableau Public, we can open it and load the data. In this tutorial, we are
going to use the dataset of water withdrawals per capita from Our World in Data. For
context, water withdrawal refers to the quantity of freshwater taken from surface water, such
as rivers, lakes, and groundwater, and used for agriculture, industry, and domestic purposes.
As you probably know from the current news cycle, there is a large variability in the available
quantity of freshwater across the world. We’ll be using Tableau to visualize these disparities
between countries.
You’ll need to first download the CSV file, and then save it as a text file, as Tableau Public
can only load certain file types. You can view which file types you can load on the Start Page.
Click ‘Text File’ in the left menu and open your text file. The new page shows the data preview
and the corresponding fields of the dataset. We can see that we have four fields and 640 rows.
Each row corresponds to a different country and to a different year.
Many of Tableau's operations are similar to those used in Excel, such as renaming, changing
the data type, or adding new fields. First, we'll modify the names of the first two fields into
‘Country Name’ and ‘Country Code’. Here, we don’t need to change the data type, since
Tableau automatically recognizes the type of field. We'll also need to have the latitude and the
longitude to build an interactive geographical map later. This is possible by changing
the geographic role of the 'Country Name' field from 'None' to 'Country/Region'. Next, we
press the Sheet 1 button, and latitude and longitude appear as additional fields.
Once they are available in your file system, we can join the datasets. We drag the table
containing the continents to the canvas. To build a relationship between the two tables, we
need to specify the field names we wish to join from the datasets. The target field in the water
withdrawals dataset is 'Country Name', while 'Entity' is the target field from the second table.
The equal operator (=) is selected to combine tables. Follow the same procedure to combine
the world population table with our target data.
Et voilà! Now the three tables are linked based on the target fields and matching field names.
This step will be useful for the next data visualizations.
Now that we are satisfied with our data, we can open the first worksheet which will contain
our first analysis. Let’s create a chart that shows the evolution of water withdrawals over time.
On the left, we have our loaded tables that have a relationship with each other. For now, let’s
focus only on the water withdrawals data. We distinguish the categorical fields marked in blue
(such as 'Country Name') from the numerical fields (for example 'Year') that are colored in
green. We also have the previously generated latitude and longitude fields.
• Drag the 'Year' field to the Columns shelf to create a column for each year.
• Drag the number of the water withdrawals to the Rows shelf.
• Add the country name to the View by inserting it into the Marks shelf. Since the aim is to
distinguish the number of water withdrawals for each country, we select the mark type of the
'Country Name' and click the color option.
• The chart is difficult to read when it includes so many countries. Let’s narrow it down and
focus only on three countries: the United States, China, and Egypt. Drag the 'Country Name'
field onto the Filters shelf. Select only the values we are interested in and press 'Ok'.
Notice that there is high variability in terms of the quantity of freshwater across the world, in
particular between the chosen countries. Later we can examine the relationship between water
withdrawals and the populations of countries.
Here comes the fun part: In the previous section, we saw that a scatterplot isn’t an efficient
way to display the water withdrawals of all the countries as there are so many. To create a
chart that can accommodate all the countries, we can use the World Map, our location
population data, and the latitude and longitude coordinates. These three fields are all necessary
to create a map view. Check here for troubleshooting map views in Tableau.
1. The fastest way to create the initial world map is to click the 'Country Name' field, which will
then be added automatically to the Marks field. However, there are two other alternatives: you
can drag it to the Marks field or drop it below the area where the chart is being built. All these
methods will create a map where every country present in the dataset is denoted with a dot.
2. Add information on the quantity of freshwater across the world. But there is an issue in the
dataset: some countries don’t have the water withdrawal information for each year, so we
want to show the latest value for each country instead of filtering the year.
For this purpose, we create a calculated field, which consists of building a new field based
on other fields. In this case, we want to select the most recent or highest value of the Year
field within the three groups. This new field will be called “max year per country”. Use the
following formula to calculate the field. For each country, continent, and year, specified by
the expression FIXED, we find the most recent year, which corresponds to the maximum of
the year MAX([Year]). {FIXED [Country Name],[Continent],[Year]: MAX([Year])}
3. Insert the new calculated field into the Filters shelf. This step is important because the max
year per country field becomes the context filter for this data visualization.
4. Drag the max year per country field to the Marks field. Then, do the same for the 'Total
Water Withdrawal Per Capita' field. Next, we can select the mark type of 'Total Water
Withdrawal Per Capita' and click the color option.
We can now observe how much water the countries are using and derive important insights.
For example, there is a massive difference between the amount of water withdrawal in the
United States (extremely high) and countries in Africa. All of these details are captured by
this vivid representation.
As you have seen, each data visualization needs to be created on a different worksheet. In this
example, we save the previous world map in a worksheet with the name water, as to not
confuse it later. Next, we created a barplot that shows the water withdrawals per continent,
filtering with max year per country like before. This worksheet has been named continent.
After building two or more charts, it’s possible to combine them into a dashboard:
• Create the dashboard by clicking on the New Dashboard icon at the bottom of the window. It
will open a new dashboard with the sheets created previously on the left-hand side.
• Start to combine them by dragging the Water worksheet onto the canvas.
• Do the same with the Continent worksheet, which will be placed at the bottom of the map.
Story Building
When you add a measure to the view, Tableau automatically aggregates its values. Sum,
average, and median are common aggregations; for a complete list,
The current aggregation appears as part of the measure's name in the view. For
example, Sales becomes SUM(Sales). Every measure has a default aggregation which is set
by Tableau when you connect to a data source. You can view or change the default
aggregation for a measure.
You can aggregate measures using Tableau only for relational data sources.
Multidimensional data sources contain data that is already aggregated. In Tableau,
multidimensional data sources are supported only in Windows.
You can change the aggregation for a measure in the view from its context menu:
Aggregating Dimensions
You can aggregate a dimension in the view as Minimum, Maximum, Count, or Count
(Distinct). When you aggregate a dimension, you create a new temporary measure column,
Note: The Count (Distinct) aggregation is not supported for Microsoft Access data sources,
and for Microsoft Excel and Text File data sources using the legacy connection. If you are
connected to one of these types of data sources, the Count (Distinct) aggregation is
unavailable and shows the remark "Requires extract." If you save the data source as an extract,
you will be able to use the Count (Distinct) aggregation.
• It can ensure a consistent level of detail when blending multiple data sources.
The formula is computed in Tableau after the data is retrieved from the initial query. The
asterisk (*) is actually a visual indicator of a special type of Null value that occurs when there
are multiple values. See Troubleshoot Data Blending(Link opens in a new window) to learn
more about the asterisk.
Below is an example of using Attribute in a table calculation. The table shows sales by market,
market size, and state. Suppose you wanted to compute the percent of total sales each state
contributed to the market. When you add a Percent of Total quick table calc (see Quick Table
Calculations(Link opens in a new window)) that computes along State, the calculation
computes within the red area shown below. This is because the Market Size dimension is
partitioning the data.
You can use Tableau to set an aggregation only for measures in relational data sources.
Multidimensional data sources contain aggregated data only.
Note: Using floating-point values in combination with aggregations can sometimes lead to
unexpected results. For details, see Understanding data types in calculations(Link opens in a
new window).
Tableau provides a set of predefined aggregations that are shown in the table below. You can
set the default aggregation for any measure that is not a calculated field that itself contains an
aggregation, such as AVG([Discount]). See Set the Default Aggregation for a Measure. You
can also set the aggregation for a field already in the view. For details, see Change the
Aggregation of a Measure in the View.
You can set the default aggregation for any measure that is not a calculated field that itself
contains an aggregation, such as AVG([Discount]). A default aggregation is a preferred
calculation for summarizing a continuous or discrete field. The default aggregation is
automatically used when you drag a measure to a view.
Right-click (control-click on Mac) a measure in the Data pane and select Default
Properties > Aggregation, and then select one of the aggregation options.
How to Disaggregate Data
Whenever you add a measure to your view, an aggregation is applied to that measure by
default. This default is controlled by the Aggregate Measures setting in the Analysis menu.
If you decide you want to see all of the marks in the view at the most detailed level of
granularity, you can disaggregate the view. Disaggregating your data means that Tableau
will display a separate mark for every data value in every row of your data source.
When Aggregate Measures is selected, Tableau will attempt to aggregate measures in the
view by default. This means that it collects individual row values from your data source into
a single value (which becomes a single mark) adjusted to the level of detail in your view.
The different aggregations available for a measure determine how the individual values are
collected: they can be added (SUM), averaged (AVG), or set to the maximum (MAX) or
minimum (MIN) value from the individual row values.
The level of detail is determined by the dimensions in your view—for information about the
concept of level of detail, see How dimensions affect the level of detail in the view.
Disaggregating your data can be useful for analyzing measures that you may want to use
both independently and dependently in the view. For example, you may be analyzing the
results from a product satisfaction survey with the Age of participants along one axis. You
can aggregate the Age field to determine the average age of participants or disaggregate the
data to determine at what age participants were most satisfied with the product.
Disaggregating data can be useful when you are viewing data as a scatter plot. See Example:
Scatter Plots, Aggregation, and Granularity.
There are various ways to add detail to a basic scatter plot: you can use dimensions to add
detail, you can add additional measures and/or dimensions to the Rows and Columns
shelves to create multiple one-mark scatter plots in the view, or you can disaggregate the
data. And, you can also use any combination of these options. This topic looks at these
alternatives using the Sample-Superstore data source.
Revert to the original one-mark view and follow these steps to develop the scatter plot view
by adding fields to the Rows and Columns shelves.
Even if you drop Continent to the right of SUM(Sales), Tableau moves it to the left
of SUM(Sales). This is because you cannot insert a dimension within a continuous
axis. Instead, your view shows a separate axis for each member of the dimension.
You now have a view that provides an overview of Sales and Profit across states and
customer segments. It can be interesting to hover over the marks in the view to see
tooltip data for various segments:
4. Applying new data calculations to your visualizations, Formatting Visualizations,
Formatting Tools and Menus, Formatting specific parts of the view.
calculated fields for many, many reasons. Some examples might include:
• To segment data
• To aggregate data
• To filter results
• To calculate ratios
Types of calculations
You create calculated fields using calculations. There are three main types of calculations
you can use to create calculated fields in Tableau:
• Level of Detail (LOD) expressions - Just like basic calculations, LOD calculations
allow you to compute values at the data source level and the visualization level.
However, LOD calculations give you even more control on the level of granularity
you want to compute. They can be performed at a more granular level (INCLUDE), a
less granular level (EXCLUDE), or an entirely independent level (FIXED) with
respect to the granularity of the visualization.
For more information, see Create Level of Detail Expressions in Tableau(Link opens
in a new window).
• Table calculations - Table calculations allow you to transform values at the level of
detail of the visualization only. For more information, see Transform Values with
Table Calculations(Link opens in a new window).
The type of calculation you choose depends on the needs of your analysis and the question
you want to answer.
Once you have determined the type of calculation you want to use, it's time to create a
calculated field. This example uses a basic calculation.
Note: The example in this article uses the Sample-Superstore data source that comes with
Tableau Desktop. To follow along with the steps in this article, connect to the Sample-
Superstore saved data source and navigate to Sheet 1.
o Enter a name for the calculated field. In this example, the field is
called, Discount Ratio.
This formula checks if sales is not equal to zero. If true, it returns the discount
ratio (Discount/Sales); if false, it returns zero.
Tip: To see a list of available functions, click the triangle icon on the right-side of the
Calculation Editor.
Each function includes syntax, a description, and an example for your reference.
For more tips, see Tips for Working with Calculated Fields in Tableau.
The new calculated field is added to Measures in the Data pane because it returns a
number. An equal sign (=) appears next to the data type icon. All calculated fields
have equal signs (=) next to them in the Data pane.
3. On the Rows shelf, click the plus icon (+) on the Category field to drill-down to
Subcategory.
If at any time you need to change a calculation, you can edit the calculated field and it will
update across your entire workbook.
1. In the Data pane, right-click the calculated field and select Edit.
For this example, the formula is changed to return a discount ratio for orders
over 2000 USD in sales:
3. Click OK.
The view updates to reflect the changes automatically. You do not need to re-add the
updated calculated field to the view.
EXP5
Sometimes, analyzing data that is stored in a crosstab format can be difficult in Tableau. When
working with Microsoft Excel, text file, Google Sheets, and .pdf data sources, you can pivot
your data from crosstab format into columnar format. If you are working with other data
sources, you can Pivot using custom SQL (Tableau Desktop).
For example, suppose you have the number of devices sold by quarter for three vendors in
three separate fields. You can pivot your data so that the vendor is in one field and the number
of devices sold is in another field.
Pivot the data
After you have set up the data source, in the grid, select two or more columns. Click the drop-
down arrow next to the column name, and then select Pivot. New columns called "Pivot field
names" and "Pivot field values" are created and added to the data source. The new columns
replace the original columns that you selected to create the pivot.
To add more data to the pivot, select another column, click the drop-down arrow next to the
column name, and then select Add Data to Pivot. Make sure that the pivot columns and
values look as expected before you begin your analysis.
To remove a pivot, click the drop-down arrow next to the name of a pivot column, and then
select Remove Pivot.
Troubleshooting pivots
• Red fields in the view and fields with exclamation points in the Data pane: Because
the original fields are replaced with new pivot fields, any references to the original
fields in the view will no longer work. They cause fields to become red in the view or
show a red exclamation point next to the field in the Data pane.
• Null values in the grid: If all of the original fields used in the pivot are removed, for
example in an extract refresh, null values display in the pivot fields.
• No pivot option: Pivot appears when you select two or more columns in a single
Microsoft Excel, text file, Google Sheets, and .pdf data source. If using a different data
source in Tableau Desktop, you can use custom SQL to pivot.
You can also use custom SQL to pivot your data, even if you aren't working Excel, text file,
Google Sheets, and .pdf data sources. When you use the UNION ALL operator in a custom
SQL query, you can take values from distinct columns and put them into a new column.
Contest
Runner Start Time End Time
To optimize your analysis of this data in Tableau, you can use the following custom SQL
query to pivot the "Start Time" and "End Time" columns so that their values are in a single
column.
Select [Runner]
, 'Start' as [Action]
, [Start Time] as [Time]
From [Contest]
Union ALL
Select [Runner]
, 'End' as [Action]
, [End Time] as [Time]
From [Contest]
• Pivots the Start Time column header into a string value called Start and adds that
value to a new column called Action.
• Pivots the End Time column header into a string value called End and adds that
value to a new column called Action.
• Pivots the Start Time and End Time columns so that their values are in a new
column called Time.
The following table shows the results of this custom SQL query.
2. Double-click the New Custom SQL option in the left pane. For more information,
see Connect to a Custom SQL Query.
3. In the Edit Custom SQL dialog box, copy and paste the following custom SQL query
and replace the contents with information about your table:
o New Value (from Column Header 1-3): New names that you give to the
original column headers, which are used as row values in the pivot.
o Pivot Column Values 1-3: The columns whose values need to be pivoted into
a single column.
o New Column Header: The name you give the new column that contains the
new row values from New Value (from Column Header 1-3).
o New Values: The name give the new column that contains the original values
from Pivot Column Values 1-3.
4. Click OK.
5. Editing and Formatting Axes, Manipulating Data in Tableau data, Pivoting Tableau
data.
you have the number of devices sold by quarter for three vendors in three separate fields.
You can pivot your data so that the vendor is in one field and the number of devices sold is
in another field.
After you have set up the data source, in the grid, select two or more columns. Click the
drop-down arrow next to the column name, and then select Pivot. New columns called
"Pivot field names" and "Pivot field values" are created and added to the data source. The
new columns replace the original
To add more data to the pivot, select another column, click the drop-down arrow next to the
column name, and then select Add Data to Pivot. Make sure that the pivot columns and
values look as expected before you begin your analysis.
To remove a pivot, click the drop-down arrow next to the name of a pivot column, and then
select Remove Pivot.
Troubleshooting pivots
• Red fields in the view and fields with exclamation points in the Data pane:
Because the original fields are replaced with new pivot fields, any references to the
original fields in the view will no longer work. They cause fields to become red in
the view or show a red exclamation point next to the field in the Data pane.
• Null values in the grid: If all of the original fields used in the pivot are removed, for
example in an extract refresh, null values display in the pivot fields.
• No pivot option: Pivot appears when you select two or more columns in a single
Microsoft Excel, text file, Google Sheets, and .pdf data source. If using a different
data source in Tableau Desktop, you can use custom SQL to pivot.
You can also use custom SQL to pivot your data, even if you aren't working Excel, text file,
Google Sheets, and .pdf data sources. When you use the UNION ALL operator in a custom
SQL query, you can take values from distinct columns and put them into a new column.
Contest
Runner Start Time End Time
Amanda 9/3/2016 3:04 PM 9/3/2016 3:25 PM
Oscar 9/3/2016 3:04 PM 9/3/2016 3:21 PM
William 9/3/2016 3:04 PM 9/3/2016 3:16 PM
To optimize your analysis of this data in Tableau, you can use the following custom SQL
query to pivot the "Start Time" and "End Time" columns so that their values are in a single
column.
Select [Runner]
, 'Start' as [Action]
, [Start Time] as [Time]
From [Contest]
Union ALL
Select [Runner]
, 'End' as [Action]
, [End Time] as [Time]
From [Contest]
6. Structuring your data, Sorting and filtering Tableau data, Pivoting Tableau data.
The Data pane has many features and functions to help you organize and customize your
data fields, find fields, and hide fields.
You can reorganize the items in the Data pane from its default layout using folders or
through sorting.
To make data sources with many fields easier to work with, you can organize the Data pane
items into folders. Items like fields, parameters, and sets can be grouped into folders.
Click the Group by Folder option in the Data pane menu, or in a field's context menu.
• When you connect to a single table in your data source, grouping by folder is enabled
by default.
• When you connect to a data source with multiple tables, grouping by table is
enabled.
• When the Group by Data Source Table option is selected, the dimensions and
measures are grouped according to the database table they belong to. This is
especially useful when you have several joined tables.
• "Group by" options are only available for relational data sources—not for
multidimensional (cube) data sources.
1. In the Data pane, select the fields you want to group together or right-click (control-
click on Mac) an empty area in the Data pane.
After you create a folder structure, you can drag fields from one folder to another or
duplicate a field you want to have available in more than one folder.
• Drag a field on top of the folder name to add the field to the folder. If the folder is
expanded, you can drag the field into the general area of the folder.
Sort fields in the Data pane
When organizing the Data pane with or without folders, you can have Tableau sort the items.
These Sort by options are also located in the Data pane menu.
7. Advanced Visualization Tools: Using Filters, Using the Detail panel, using the Size
panels, customizing filters, Using and Customizing tooltips, Formatting your data with
colors.
To create a visualization, drag the data fields you want to visualize to the workspace,
then Lens uses visualization best practices to apply the fields and create a visualization that
best displays the data.
• Create area, line, and bar charts with layers to display multiple indices and chart
types.
• Change the aggregation function to change the data in the visualization.
• Create custom tables.
• Perform math on aggregations using Formula.
• Use time shifts to compare the data in two time intervals, such as month over month.
• Add annotations and reference lines.
Create visualizationsedit
If you’re unsure about the visualization type you want to use, or how you want to display the
data, drag the fields you want to visualize onto the workspace, then let Lens choose for you.
If you already know the visualization type you want to use, and how you want to display the
data, use the following process.
1. Before you drag fields to the workspace, open the Visualization type dropdown,
then select the visualization you want to use.
2. To view more visualizations that Lens automatically created for the fields,
click Suggestions. If one of the Suggestions meets your visualization needs,
click Save and return to add it to the dashboard.
1. Drag the fields directly to the layer pane. Lens automatically selects the aggregation
function.
2. If you want to learn more about the data a field contains, click the field.
3. To visualize more than one data view, click Add layer, select the layer type, then
select the data view.
1. To change the aggregation Quick function and display options, click the field in the
layer pane.
2. To delete a field, close the configuration options, then click X next to the field.
3. To duplicate a layer, click in the layer pane, then select Duplicate layer.
4. To clear the layer configuration, click in the layer pane, then select Clear
layer.
You can manually apply the changes you make, which is helpful when creating large and
complex visualizations. To manually apply your changes, click Settings in the toolbar, then
deselect Auto-apply visualization changes.
• To create a visualization with fields in a different data view, open the data view
dropdown, then select the data view.
For more information about data views, refer to Create a data view.
For more information about adding fields to data views and examples, refer
to Explore your data with runtime fields.
All columns that belong to the same layer pane group are sorted in the table.
4. To change the display options, click a Metrics field in the layer pane, then configure
the following options:
Create another table, which will sit underneath this in the dashboard, showing the total discount.
Notice the filter for Market, which applies to both worksheets.
Build your dashboard using a vertical container, making the table resize
Our dashboard is going to be very simple, containing the 2 tables and a filter.
Create a new dashboard and drag in the Country table. Next drag in a Vertical
Container below the table.
The next step is to place the Country table into the container.
This is important – to drop an object into a Tableau container, click-drag and hold it over the
container. When the container outline turns blue you can drop the object; when the container
outline is blue it means the item will fit within it.
9. Tableau file types, publishing to Tableau Online, Sharing your visualizations,
printing, and Exporting.
You can save your work using several different Tableau specific file types: workbooks,
bookmarks, packaged data files, data extracts, and data connection files. Each of these file
types are described below. For related details, see Save Your Work.
• Workbooks (.twb) – Tableau workbook files have the .twb file extension. Workbooks
hold one or more worksheets, plus zero or more dashboards and stories.
• Bookmarks (.tbm) – Tableau bookmark files have the .tbm file extension. Bookmarks
contain a single worksheet and are an easy way to quickly share your work. For more
information, see Save a bookmark(Link opens in a new window).
• Packaged Workbooks (.twbx) – Tableau packaged workbooks have the .twbx file
extension. A packaged workbook is a single zip file that contains a workbook along
with any supporting local file data and background images. This format is the best way
to package your work for sharing with others who don’t have access to the original
data. For more information, see Packaged Workbooks.
• Extract (.hyper) – Tableau extract files have the .hyper extension. Extract files are a
local copy of a subset or entire data set that you can use to share data with others, when
you need to work offline, and improve performance. For more information, see Extract
Your Data.
• Data Source (.tds) – Tableau data source files have the .tds file extension. Data source
files are shortcuts for quickly connecting to the original data that you use often. Data
source files do not contain the actual data but rather the information necessary to
connect to the actual data as well as any modifications you've made on top of the actual
data such as changing default properties, creating calculated fields, adding groups, and
so on. For more information, see Save Data Sources.
• Packaged Data Source (.tdsx) – Tableau packaged data source files have the .tdsx
file extension. A packaged data source is a zip file that contains the data source file
(.tds) described above as well as any local file data such as extract files (.hyper), text
files, Excel files, Access files, and local cube files. Use this format to create a single
file that you can then share with others who may not have access to the original data
stored locally on your computer. For more information, see Save Data Sources.
These files can be saved in the associated folders in the My Tableau Repository directory,
which is automatically created in your My Documents folder when you install Tableau. Your
work files can also be saved in other locations, such as your desktop or a network directory.
You can specify a new location for the Tableau repository if you are not using the default
location in your Documents folder. For instance, if you are required to have your data on a
network server instead of on your local machine, you can point Tableau at the remote
repository.
1. Select File > Repository Location.
2. Select a new folder that will act as the new repository location in the Select a
Repository dialog box.
Changing the repository location does not move the files contained in the original repository.
Instead, Tableau creates a new repository where you can store your files.
10. Creating custom charts, cyclical data and circular area charts, Dual Axis charts.
A dual axis chart is used to present the relationship between two variables. More specifically,
these charts are useful for demonstrating the relationship between two or more measures with
different amplitude and scale. The dual axis charts help in presenting plenty of information in
the limited space present on your dashboard and also allows you to understand the trends, you
may have missed otherwise.
For example, in our US Super Store dataset, we have the Profit and Sales measures. These two
measures have different magnitude and scale. Let’s directly dive into the implementation in a
stepwise manner.
Here, for our visualization, we are going to use three attributes Sub-Category from the
dimensions and two measures i.e. Profit and Sales.
Open a new worksheet and add the Sub-category from the dimension pane to the Columns
Now pick Sales from the Measures pane and drop in the Row shelf below the Sub-Category.
Similarly, Select Profit measure and drop next to the Sales in Row shelf. After this step, your
visualization will look as shown in the image below.
Here we have two charts present on multiple axes. The next step is to convert these two
different charts into a dual axis chart. For this click on the triangle present on the profit pill in
the rows shelf.
Hereafter, you will have a drop-down menu just select the Dual axis option from that.
Once you select the Dual axis boom! your visualization changes completely.
Although you have a dual axis visualization, they are on different scales. Now there is a
need to bring both measures on the same scale using synchronize axis. For this right-click on
any axis Profit or Sales and select synchronize axis from the menu. As shown in the following
image