Tableau Tutorial
Tableau Tutorial
Three kinds of annotations: mark, point, and area. After you add an annotation, you can edit,
re-position, format, and remove it.
Adding Annotations
Annotations are an important part of publishing and sharing a view. Use annotations to call out
a specific mark, a specific point such as a value on the axis or a reference line, or an area such
as a cluster of scatter marks.
To add an annotation:
1. Right-click (Control-click on Mac) the view where you want to add an annotation and
select Annotate.
3. In the Edit Annotation dialog box, type the text you want to show in the annotation.
Use the Insert menu to insert dynamic variables into the annotation text. For example,
the annotation can display data values that update as the underlying data changes. The
dynamic variables that are available are dependent on whether you are annotating a
mark, point, or area. Only relevant variables are available for each of these types of
annotations. For example, mark annotations can include dynamic data about that
specific data point such as dimension and measure values. Point annotations don't refer
to a specific data point but rather a place in the view. For that reason, point annotations
can only include dynamic information about that point, such as measure values along
the axes. Finally, when adding area annotations, only data relevant to the entire sheet is
available, such as title and sheet name.
Insert the All Values option using the Insert menu to show the data from the fields in the
view. As you add more detail to the view, this text is updated to show the live data.
4. When finished, click OK.
Mark Annotations
When you select a mark annotation the body and line are selected and several resize handles
display. Use these handles to resize the body and line.
Point Annotations
A point annotation marks a specific point in the view such as a reference line or a value on an
axis. Point annotations display as text with a line. When you select a point annotation, several
resize handles display. Use these handles to reposition and resize the body and line.
To reposition the body:
Click and drag the body of the selected annotation to a new position. As you move the
body, the line is automatically resized so that it continues to point at the specific point
you selected.
Area Annotations
An area annotation is a way to highlight or call out an area in the view. Area annotations are
not associated with any particular mark, in fact, these annotations are commonly used to call
out several marks. When you select an area annotation, several resize handles and two text
handles display. Use these handles to reposition and resize the box and text.
Click and drag the box of the selected annotation to a new position.
To resize the box
Click and drag one of the box resize handles
Sometimes it's useful to convert a continuous measure (or a numeric dimension) into bins.
For example, suppose you create a view with Profit on Rows and State on Columns. You could
consider the State field as a set of bins—each profit value is sorted into a bin corresponding to
the state from which the value was recorded. But if you want to bin Profit values without
reference to a dimension, you can create a numeric bin, with each bin corresponding to a range
of values so that each profit value is sorted into a bin.
Note: You can bin data only for relational data sources. This feature is not supported for cube
(multidimensional) data sources.
When you bin a measure you create a new dimension. That's because you are creating a field
with a limited and discrete set of possible values out of a field with an unlimited, continuous
range of values. However, once the dimension is created you can convert it to a continuous
dimension. This can be useful if you want to create a histogram.
Create a Binned Dimension:
1. In the Data pane, right-click (control-click on Mac) a measure and select Create >Bins.
2. In the Create Bins dialog box, accept the proposed New field name or specify a
different name for the new field.
3. Either enter a value in the Size of bins field or have Tableau calculate a value for you.
If Tableau can perform the optimizing calculation quickly enough (in less than 1.5
seconds), the value you see initially in Size of bins is Tableau's estimate of the optimal
bin size.
If Tableau cannot perform the optimizing calculation quickly, the Size of bins field
defaults to 10. In this case you can click Suggest Bin Size to have Tableau perform the
optimizing calculation.
The formula that Tableau uses to calculate an optimal bin size is
Number of Bins = 3 + log2(n) * log(n)
In the formula, n is the number of distinct rows in the table. The size of each bin is
determined by dividing the difference between the smallest and the largest values by
the number of bins.
The four read-only fields in the lower part of the Create Bins dialog box show you the data that
Tableau uses to suggest a bin size. You can also consider these values if you want to set a bin
size manually. The values are:
Diff The difference between the field's minimum and maximum values.
After you click OK to dismiss the Create Bins dialog box, a new binned field appears in the
Dimensions area of the Data pane.
When you add a binned dimension to the view, each bin acts as an equal-sized container that
summarizes data for a specific range of values. Column or row headers are created, where each
bin label designates the lower limit of the range of numbers that is assigned to the bin. Note
that the lower limit is inclusive.
Blended Axis:
Drag and Drop the Year from Dimension Region to Column Shelf. Next, Drag and Drop the Sales
Amount from Measures to Rows Shelf. Since it is a Measure value, Sales Amount will be
aggregated to default Sum.
To create blended axis in tableau Report, Please drag and drop the Total Product Cost from
Row Shelf to Sales Amount axis.
Following screenshot will show you the tableau blended axis report
Let us change the Year value to Month for detailed report.
Now you can see the blended axis report for each month
Let us change the value from Month names to all months present in each year.
Now you can see the detailed blended axis report for each month present in 2011, 2012, 2013,
and 2014
Add Analytics to Tableau Blended Axis Report
In order to add analytics, please navigate to Analytics tab, and double-click on the Forecast
option under the Model section.
Once you double click on the Forecast option, Forecast will be added to chart.
Hope you understood the creation of Tableau Blended Axis.
Bookmarks:
You can save a single worksheet as a Tableau bookmark. Bookmarks can be accessed from any
workbook using the Bookmarks menu. Bookmarks are convenient when you have worksheets
that you use frequently.
To save a Tableau bookmark:
1. Select Window > Bookmark > Create Bookmark.
2. Specify the bookmark file name and location in the Create Bookmark dialog box.
Tableau saves the file with a .tbm extension. The default location is the Bookmarks folder in the
Tableau Repository. However, you can save bookmarks to any location you choose. Bookmarks
that are not stored in the Tableau repository do not appear on the Bookmark menu.
You can organize bookmarks into folders in the same way you organize files or documents. This
can be useful when you have a large number of bookmarks to manage. For example, you might
organize bookmarks based on employee name, product types, or sales results. You can organize
bookmarks by creating a new folder, renaming an existing folder, renaming existing bookmark
files, and so on.
Delete bookmarks the same way you would delete any other file on your computer. After you
delete a bookmark from the Bookmarks folder in the Tableau Repository, it is removed from
the Bookmarks menu the next time you start Tableau.
While bookmarks are generally a snapshot of the worksheet and include the data connection,
formatting, etc., a bookmark does not include parameter values and the current page setting on
the Pages shelf.
The Combined Sets are very useful to compare two existing sets for further analysis. In this
article we will show you, How to Create Combined Tableau sets with example.
Name: Please specify the unique name for the set. Make sure, the name should reflect
the set functionality.
Sets: Please select or change the existing Set from Drop down menu. First set will act as
Left Set and second will act as Right set
All members in Both Sets: This option is similar to UNION ALL. If you select this option
then Combined Set will hold all the members from Left Set and Right Set.
Shared Members in Both Sets: This option is similar to INTERSECT. If you select this
option then Combined Set will hold matching members from Left Set and Right Set. It
means, Every record should match the condition present in Left Set and Right Set
Left Set except Shared Members: If you select this option then Combined Set will hold all
the members from Left Set except matching members from Right Set.
Right Set except Shared Members: If you select this option then Combined Set will hold
all the members from Right Set except matching members from Left Set.
Once you select Create Combined Set option, a new window called Create Set will open to
configure the option.
All members in Both Sets
In this example we are going to find the Total number of States Present in Both Random 6 and
Top 10 States. In order to get all the records from both sets we have to select the All members
in Both Sets option
Click OK to finish Creating our first Combined tableau Sets. Next, Please Drag the newly created
set (States Present in Both Random 6 and Top 10 States) from Sets region to Row Shelf and
places it before the State filed as shown below.
From the above listing you can observe that, tableau report is displaying 12 records in IN
section. This is because, there are 16 records in both Random 6 States (6) and Top 10 States By
Profits (10) sets and within that 16, there are 4 common records so it is displaying 12 records.
Shared Members in Both Sets
In this example we are going to find the Total number of Common States Present in Random 6
States and Top 10 States by Profits sets. In order to get the Common records from both sets we
have to select the Shared Members in Both Sets option
Click OK to finish creating new Combined Set. Let us replace the States Present in Both
Random 6 and Top 10 States set with our newly created set, called Random States Present in
Top 10 List and see the result.
From the above listing you can observe that, California, Delaware, Georgia and Indiana are the
common fields in Random 6 States and Top 10 States by Profits sets.
In this example we are going to find the Total number of States which are Not Present in Right
Set, Which is Top 10 States by Profits set. In order to get all the records from Random 6
States except the records from Top 10 States by Profits set, we have to select the Left Set
except Shared Members option
Click OK to finish creating new Combined Set. Let us replace the Random States Present in Top
10 List with Random 6 States not Present in Top 10 List and see the results.
From the above listing you can observe that, tableau report is displaying 2 records (District of
Columbia and Idaho) in IN section. This is because, there are 6 records in Random 6 States and
within that 6, there are 4 common records in Random 6 States and Top 10 States By
Profits sets so it is displaying 2 records.
Right Set except Shared Members
In this example we are going to find the Total number of States which are Not Present in Left
Set, Which is Random 6 States set. In order to get all the records from Top 10 States by
Profits set except the records from Random 6 States, we have to select the Right Set
except Shared Members option.
Click OK to finish creating new Combined Set. Let us replace the Random 6 States not Present
in Top 10 List set with our newly created set, called Top 10 States Not present in random 6
List and see the result.
Data Blending In Tableau
Data Blending in Tableau is very useful to join two data sources. For example, if you want to
generate tableau report using multiple data sources (or different data sources) then we can
simply use this Data Blending technique to join those data sources.
NOTE: In order to perform Data Blending in Tableau, We need at least one common field in
both data sources. It doesn’t matter, whether it is integer or string.
Approach 1
First, we connected to Employees.xlsx workbook and added the Employee List sheet to data
region as shown below
In this example, our requirement is to create table report with employee first name, last name,
occupation, Sales and yearly income. So, we created simple table report with Occupation, Last
name, First name on Rows and Sales Amount and Yearly income on columns. Let us see the
report preview.
Scenario: Suddenly, Client changed the requirements and asked us to add department and
Salary Hike percentage details for every Employee. Here the real problem is, department and
Salary Hike percentage data is present in Master SQL Server database. It means, we have to
combine few columns from Local Excel Sheet and few from SQL Database
To do this, Please navigate to Data menu and select New Data Source option from Menu as
shown below or click on the Cylinder symbol
Once you select New Data Source option, following window will be appeared to Connect. Here,
we have to connect with SQL so select Microsoft SQL Server as shown below
From the below screenshot you can observe that, we selected the Department table from
server database.
Following screenshot will show the newly added data source (SQL) Department table
Let us add the Department name to the Rows Card. From the below screenshot you can
observe that, Tableau is displaying little orange tick mark at department name and also
displaying the warning message.
If you read the warning message, it is pretty straight forward message saying that, there is no
relation between Employees and department so, please add the relation.
In order to add relationship, Go to data menu and select Edit Relationships. Option as shown
below
Once you select Edit Relationships. Option, a new Relationships window will be opened.
Following are the option available in this window.
Primary Data Source: Data Source from which we first dragged the fields (Dimension or
Measure) into report region is called as Primary data source. Tableau will display little
Blue tick mark beside this data source
Secondary Data Source: Data Source which is not primary. Tableau will display little
orange tick mark beside secondary data source
Automatic: If there are any common Filed names in both the data sources then tableau
will automatically detect the possible relationship between those two fields.
Custom: If there are no common Filed names in the data sources, we have to select
Custom option and add the relationship between them. For now, we are selecting this
option
Dept. ID in Employee table and Id in Department table is the key columns we are going to use
for Data Blending on Employee and Department table as shown below.
Once you specified the relationship, tiny URL link will be appeared besides the Id column. From
the below screenshot, when you hover on that link, Use Id as linking filed tooltip is displaying.
Click the link button to enable Data blending in tableau
Once you click on the link button, link button color will be changed to Orange color and Our
Department column is displaying data. Remember, Null values will be displayed, if there is no
matching records in Department
To do this, please select and right-click on the Id column will open the context menu. Please
select the Aliases.Option from the context menu as shown below
Once you selected the Aliases. Option, a new window will be popped up to rename the filed.
Let us change the Id Column to Dept. ID
Once you click OK button, Tableau will automatically detects the relationship between Dept. ID
in Employee table and Dept. ID in Department table. It means, you don’t have to create
relationship on your own. From the below screenshot you can observe that, tiny URL link will be
appeared besides the Dept. ID column. Click the link button to enable Data blending in tableau.
Once you click on the link button, link button color will be changed to Orange color as shown.
Let us add Department Name and Hike Rate to finish the business requirement.
Remove or Edit Relationships in Tableau
Please navigate to Data menu and select Edit Relationships. Option from Menu as shown.
Once you select Edit Relationships.Option, a new Relationships window will be opened. Please
select the Relationship you want to remove and Click Remove button. In this example we have
only one relationship between Dept. ID and Id so, we selected it and removed.
Since, we are using Department Name and Hike Rate in Tableau report, following warning
message is displayed.
Next, One more warning message which we seen before. Once you click OK button, Tiny URL
link will be remove besides the Id column as shown below
That’s it;we successfully removed the relationship required for data blending in tableau
In the import file, the names of the columns define the geographic roles. When extending an existing
role, the column names must match the existing geographic roles in the hierarchy that you are
extending. This will ensure that the new locations are added to the proper roles and hierarchies.
See the table below for information on how to organize hierarchies in your import file.
Built-In Hierarchy Columns to include in the .csv file (in order; left to
right)
In addition to the Country (Name) column, you can optionally include the following columns: Country
2 char (ISO 3166-1), Country 3 char (ISO 3166-1), and Country (FIPS 10). If you include these
columns, they should be just to the right of the Country (Name) column in any order.
Note: The highest level in the hierarchy is Country and cannot be extended to include higher levels
such as Continent, etc.
Once you have created your import file, save the file as a Comma Delimited (.csv) file (Windows
Comma Separated if on a Mac) in a folder on your computer.
The next level is Country, so its import file should contain columns for Theater, Country, Latitude and
Longitude.
Make sure that each file in the hierarchy contains columns for the current level and all levels above
it. For example, the City import file, the last geographic role in the hierarchy, would contain columns
for Theater, Country, Region and City.
Save each import file into a single folder and name each file with the level it represents. For this
example there are four import files named theater.csv, country.csv, region.csv, and city.csv.
(Back to top)
You're now ready to start building a map view with your custom geographic roles. For more
information on how to build a map
Types of LOD
There are three main types of LOD expressions.
FIXED LOD This expressions compute values using the specified dimensions without reference to
any other dimensions in the view.
INCLUDE LOD This level of detail expressions compute values using the specified dimensions in
addition to whatever dimensions are in the view.
EXCLUDE LOD These levels of detail expressions subtract dimensions from the view level of
detail.
Next we drag the Region and State filed to the Rows shelf and the
calculated field to the Text shelf under the Marks card. We also drag
the Region field to the Color shelf. This produces the below view which
shows a fixed value for different states. That is because we have fixed
the dimension as region for the calculation of Sales value.
INCLUDE Level of Detail Expressions
INCLUDE level of detail expressions compute values using the specified
dimensions in addition to whatever dimensions are in the view. Let's
calculate the sum of sales per state for each sub-category of products.
For this we drag the Sub-Category field to the Rows shelf. The we write
the expression as shown below in the Columns shelf. It produces the
below view which includes both the dimensions in the calculations.
EXCLUDE Level of Detail Expressions
EXCLUDE level of detail expressions specify dimensions to exclude
from the view level of detail. Let's exclude Region from Sales figure
calculated for every month. We create the formula as shown below.
On dragging the relevant fields to the respective shelves we get the
final view for the EXCLUDE LOD.
Tableau Rank Calculation Advanced
21-12-2016 by sureshLeave a Comment
In our previous article, we had shown you the basic approach to calculate rank in tableau. In this
article we will show you, How to calculate Tableau Rank using the table calculation with
example. For this we are going to use the Employee table present the SQL Server. I suggest you
to refer Connecting Tableau to SQL Server article to understand the configurations. Following
screenshot will show you the data inside the Table, and as you can see it has 14 records:
Tableau Rank Calculation – Advanced
In this example, we will show you the advanced approach to calculate the tableau Rank. For this,
we are going to Drag and Drop the Occupation, Last Name, and First Name from Dimensions
Region to Rows Shelf. Next, drag the Yearly Income from Measures region to Text filed present
in the Marks Shelf.
In order to assign the Ranks in tableau we have to add the table calculation. To do so, please
click on the Down arrow besides the Yearly Income measure (change as per your requirement),
or right click on it will open the context menu. From the list of available options, please select
the Create option and then Calculated Field… option as shown below.
Once you click on the Calculated Field… option, a new window will be opened to write the
calculation.
RANK
In this example, we will calculate the rank so, we are using the RANK function. This function
accepts two arguments first, aggregated measure (or an expression) second, ranking order
(ascending, or descending). Here second argument is optional, and by default it is assigned as
DESC (descending).
Rank Function will assign the same rank to identical value. For example, if we have 100, 200,
200, 400 then the function will return the ranks as 1, 2, 2, 4 in ascending order
TIP: Click on the arrow that we rounded to show or hide the existing function. You can search
for the required function, and then check its syntax by selecting one.
Once you click on the OK button, tableau will assign the ranks for each record based on the
Yearly Income values
Edit Tableau Rank
To edit the existing table calculation, please click on the down arrow beside the table calculation
will open the context menu. Here you have to select the Edit Table Calculation option as shown
below.
Once you click on the Edit Table Calculation option, a new window called Table Calculation
will be opened as we shown below. As you can see, tableau has selected the Compute using
option as Table (down) by default.
Let us change the Compute using option from Table (down) to Specified Dimensions
(Occupation, Last name, and First Name). Note, we are selecting the Occupation dimension for
the Restarting every option. This will allow tableau to assign the ranking for each occupation. Or
we can simply say, Rank yearly income partitioned by Occupation.
Now you can see the result. It is calculating the Rank for each Partition (here, it is Occupation)
RANK_DENSE
In this example, we are using the RANK_DENSE function. This function accepts two arguments
first, aggregated measure (or an expression) second, ranking order (ascending, or descending).
Here, second argument is optional, and by default it will assign DESC (descending).
Rank_dense Function will assign the same rank to identical value but it will not skip the next
rank. For example, if we have 100, 200, 200, 400 then the function will return the ranks as 1, 2,
2, 3 in ascending order. In order to change the existing table calculation, please click on the
down arrow beside the table calculation and select the Edit.. option as shown below.
Let us change the function name from RANK to RANK_DENSE or write down your custom
function and click OK.
As you can see the result, It is calculating the Dense Rank for each Partition (here, it is
Occupation)
RANK_MODIFIED
In this example we are using the RANK_MODIFIED function. This function accepts two
arguments first, aggregated measure (or an expression) second, ranking order (ascending, or
descending). Here, second argument is optional, and by default it will assign DESC
(descending).
Rank_Modified Function will assign the same rank to identical value. The Highest value will be
ranked as 1, and the next two identical values will be ranked as 3. For example, if we have 100,
200, 200, 400 then the function will return the ranks as 1, 3, 3, 4 in ascending order
Now you can see the result. It is calculating the Modified Rank for each Occupation
RANK_PERCENTILE
In this example we are using the RANK_PERCENTILE function. This function accepts two
arguments one, aggregated measure (or an expression) second, ranking order (ascending, or
descending). Here, second argument is optional, and by default it is assigning the DESC
(descending).
Now you can see the result. It is calculating the Percentile Rank for each Occupation
RANK_UNIQUE
In this example we are using the RANK_MODIFIED function. This function accepts two
arguments first, an expression second, ranking order (ascending, or descending). Here, second
argument is optional, and by default it will assign DESC (descending).
Rank_UNIQUE Function will assign the unique rank to identical value. For example, if we have
100, 200, 200, 400 then the function will return the ranks as 1, 2, 3, 4 in ascending order
As you can see the result. It is assigning the Unique Rank for each items present in the
Occupation
Tableau Rank Calculation Basic
How to do the Tableau Rank Calculation with example. Following screenshot will show you the
data inside the Table.
Let me show you the list of available ranking options in tableau.
AVAILABLE RESULT
OPTIONS
Competition (1, 2, 2, 4) This option will assign the identical rank to Identical values and skips the next
rank. For example, if we have 100, 200, 300, 300, 400 then this option will
assign ranks as 1, 2, 3, 3, 5
Modified Competition Modified Competition option will assign the identical rank to duplicate values.
(1, 3, 3, 4) The Highest value will be ranked as 1, and the next two identical values will be
ranked as 3. The next value will be ranked as 4. For example, if we have 100,
200, 300, 300, 400 then this option will assign ranks as 1, 2, 4, 4, 5
Dense (1, 2, 2, 3) Dense option will assign the identical rank to Identical values but it will not
skips the next rank. For example, if we have 100, 200, 300, 300, 400 then this
option will assign ranks as 1, 2, 3, 3, 4
Unique (1, 2, 3, 4) This option will allocate unique values to each and every record. Though there
are identical values, it will assign unique ranking. Here, ranking factor will be
decided by the Order we specify.
Ascending and Descending Order Option: Under the Rank Calculation Type we have two
options:
1. Ascending: Rank will be assigned starting from lowest to highest. For example, if we have
100, 200, 300, 300, 400 then it will assign ranks as 1, 2, 3, 3, 5
2. Descending: Rank will be assigned starting from highest to lowest. For example, if we
have 100, 200, 300, 300, 400 then it will assign ranks as 4, 3, 2, 2, 1
In order to assign the Ranks in tableau we have to add the table calculation. To do so, please
click on the Down arrow besides the Yearly Income measure (change as per your requirement)
will open the context menu. From the list of available options, either you can select the Add
Table Calculation option or Quick Table Calculation option. For now, we are selecting
the Quick Table Calculation option, and then Rank option
Once you select the Rank option, tableau will assign the ranks for each record based on the
Yearly Income values
I think it will be nice to show the yearly Income values so that you can compare the Rank value
with the yearly Income. Let us add the Yearly Income to Columns Shelf. As you can see it will
create the Horizontal Bar chart. Please use the Show Me window to change the bar chart to
Text as we show below.
Following screenshot will show you the better view.
Once you click on the Edit Table Calculation option, a new window called Table Calculation will
be opened as we shown below. As you can see, tableau has selected the Rank Calculation Type
as Competition (1, 2, 2, 4), and Compute using option as Specified Dimensions (Occupation,
Last name, and First Name) by default. Here, you can uncheck the unwanted dimensions as
well.
Let us change the Rank calculation type from Competition to Modified Competition (1, 3, 3, 4),
and you can see the change in Rank
Let us change the Rank calculation type from Modified Competition (1, 3, 3, 4) to Dense (1, 2, 2,
3) and you can see the change in Rank
Lastly, we changed the Rank calculation type from Dense (1, 2, 2, 3) to Unique (1, 2, 3, 4) and
you can see the change in Rank
Tableau Rank Calculation for Cross Tab reports
In this example we will show you, How to calculate the rank in tableau for the cross tabled
reports (OR) calculate the rank for each partition. For this, we removed the First name from
Rows Shelf, and changed the Compute Using option to pane (down then across). Here we don’t
have any cross tabs so, it will calculate by going down.
First, we changed the Rank Calculation type to Competition (1, 2, 2, 4), and you can see the
result. It is calculating the Rank for each Partition (here, it is Occupation)
Let us change the Rank calculation type from Competition to Modified Competition (1, 3, 3, and
4). From the below screenshot you can see the Modified Competition Rank partitioned by
occupation.
Let us change the Rank calculation type from Modified Competition (1, 3, 3, 4) to Dense (1, 2, 2,
3). Form the below screenshot you can see the Dense Rank partitioned by occupation
Lastly, we changed the Rank calculation type from Dense (1, 2, 2, 3) to Unique (1, 2, 3, 4). You
can see the Unique Rank partitioned by occupation
Once you click on the Add Table Calculation option, a new window called Table Calculation will
be opened.
Please change the calculation type from Difference From option to Rank
Next, change the Compute Using option from table (down) to Pane (across then down)
Tableau Running Total Calculation
21-12-2016 by sureshLeave a Comment
In this article we will show you, How to calculate the Tableau Running Total with example. For
this we are going to use the Data Source we created in our previous article so, Please visit Data
Labels in Tableau Reports article to understand the Data Source.
Now you can see the running total for each quarter
Add Secondary Calculation
Tableau allows us to add the secondary calculation to the report. It is very helpful to calculate
further on top of the existing calculation. To do so, Please check the Add Secondary
Calculation option as shown below.
Please leave all the default settings, and change the Secondary Calculation Type option from the
Difference From to Percentage Difference From
Following screenshot will show you the Percentage of difference in running total
Split a Field into Multiple Fields
If you have string fields in your data that contain multiple units of information, for example, the
first and last name of a customer, it might be easier to analyze the data if you split the values in
that field into separate fields. You can use split or custom split options in Tableau to separate
the values based on a separator or a repeated pattern of values present in each row of the
field. In this example, the common separator is a space character ( ).
The new fields created by the split or custom split are added to the data source as calculated
fields.
Splits and custom splits are based on the SPLIT string function. For more information, see String
Functions.
You can tell if your data supports the SPLIT function by checking the field drop-down menu:
On the data source page, check the menu for Split and Custom Split.
On the Data pane in the worksheet, check the menu for Transform > Split and Custom
Split.
Because different connection types support different functionality in Tableau, you may need to
check both places to determine if your data supports the split and custom split options.
Custom split
You can use the custom split option to specify a common separator for the split. Like the split
option, a custom split can separate a field’s values in up to ten new fields. In addition, you can
choose to split the values at the first n occurrences of the separator, the last n occurrences of
the separator, or at all occurrences of the separator. The data type of the new fields generated
by the custom split always results in a string data type.
Note: You can also access the custom split option from the Data pane. In the Data pane, right-
click the field you want to split, and then select Transform > Custom Split.
If you do not like the results of the split, you can go to the Data pane and edit the calculated
fields that are created by the split. Alternatively, you can click undo in the toolbar or remove
the split.
In this case, the split will create a new field with the following values:
98102
98109
98119
98195
The split will not create a separate field for “ZIP-“ because the split uses it as a separator
Tableau Desktop comes with color palettes that have been carefully designed to work well
together and effectively apply color to data in many situations, such as on maps, heat maps, bar
charts, etc. You can also create and use your own custom color palettes by modifying
the Preferences.tps file that comes with Tableau Desktop. For example, you can create a
custom categorical palette that matches your company's brand.
You can add as many custom palettes as you like, each with as many colors as you want. When
you modify Preferences.tps to add colors, use the standard HTML format for the new colors
(hexadecimal value #RRGGBB or Red Green Blue format). When you save the workbook, the
color information is embedded in Preferences.tps, but it won't be included as reusable color
encoding. This means that any colors that are in use are shown for anybody opening the
workbook; however, if they don't have the modified Preferences.tps file, they can't use the
color information for new color encoding.
Tableau doesn't test or support custom color palettes, so be sure to back up your workbooks
before you continue. Also, there is no guarantee that custom color palettes you create will
work with future Tableau Desktop upgrades.
Edit your preferences file
The Preferences.tps file is located in your My Tableau Repository. The file is a basic XML file
that you can open in a text editor to modify. An unedited preferences file looks like this:
A categorical color palette contains several distinct colors that can be assigned to discrete
dimension members. For example, when you put a discrete dimension such as Region on
the Color, the categorical color legend is used.
The following is an example of what to add between the preferences tags to add a categorical
color palette. Note that the type attribute is specified as regular, which identifies this palette as
a categorical palette.
To create a custom categorical color palette:
1. In the Preferences.tps file, between the "preferences" tags, paste the following:
<color-palette name="My Categorical Palette" type="regular" >
<color>#eb912b</color>
<color>#7099a5</color>
<color>#c71f34</color>
<color>#1d437d</color>
<color>#e8762b</color>
<color>#5b6591</color>
<color>#59879b</color>
</color-palette>
2. Save the Preferences.tps file and then restart Tableau Desktop.
3. Open the Superstore - Sample data source.
4. From the Dimensions pane, drag a discrete dimension, such as Region, to Color.
5. Click the color legend menu arrow and select Edit Colors.
6. In the Edit Colors dialog box, from the palette drop-down list, select your new
custom palette.
7. Click the Assign Palettebutton to assign the custom colors to each respective field.
8. Click OK.
Create a custom sequential color palette
Another type of palette is the sequential color palette. Typically, this type of palette shows a
single color, varying in intensity. This type of color palette is used for continuous fields, typically
for measures.
The following is an example of what to add between the preferences tags to add a sequential
color palette. Note that the type attribute is specified as ordered-sequential, which identifies
this palette as a sequential palette. Also, for sequential palettes you must specify each variant
of the color in the sequential color range.
To create a custom sequential color palette:
1. In the Preferences.tps file, between the preferences tags, paste the following:
<color-palette name="My Sequential Palette" type="ordered-sequential" >
<color>#eb912b</color>
<color>#eb9c42</color>
<color>#ebad67</color>
<color>#eabb86</color>
<color>#eacba8</color>
<color>#ebd8c2</color>
</color-palette>
2. Save the Preferences.tps file and then restart Tableau Desktop.
3. Open the Superstore- Sample data source.
4. From the Measures pane, drag the measure (e.g., Sales) to Color.
5. Click the color legend menu arrow, and select Edit Colors.
6. In the Edit Colors dialog box, from the palette drop-down list, select your custom
palette.
7. If you want each color gradation to be defined within a box, select the Stepped
Color check box, and in the Steps text box, type the number of color steps you want
to display in the bar.
8. Click the Advanced button.
9. Select the Start check box, and in the text box, type the low end number you want
for the continuum.
10. Click the Apply button to see the result, and make adjustments as needed. The
default for sequential color is to make the high end of the continuum pale and the
low end intense; select the Reversed check box to make the high end intense and the
low end, pale (this is the default when you keep the Automatic palette selection).
The third type of color palette is a diverging color palette. A diverging palette shows two ranges
of values using color intensity to show the magnitude of the number and the actual color to
show which range the number is from. Diverging palettes are most commonly used to show the
difference between positive and negative numbers.
The following is an example of what to add between the preferences tags to add a diverging
color palette. Note that the type attribute is specified as ordered-diverging, which identifies this
palette as a diverging palette.
To create a custom diverging color palette:
1. In the Preferences.tps file, between the preferences tags, paste the following:
<color-palette name="My Diverging Palette" type="ordered-diverging" >
<color>#eb912b</color>
<color>#59879b</color>
</color-palette>
2. Save the Preferences.tps file and then restart Tableau Desktop.
3. Open the Superstore - Sample data source.
4. Click the Assign Palette button. The colors in the palette are used in the order they
appear in the Preferences file.
If you add a sequential or diverging palette, remember to change the "type" attribute from
"regular" to one of the following:
ordered-sequential
ordered-diverging
(Optional): Assign a default custom palette to dimensions and measures and publish as a
data source
After you save the workbook, the custom color palette information is embedded in the
workbook (for Excel and text file-based workbooks, in the .twbx) and therefore only available
for that workbook. This means that colors that are in use are shown for anybody opening the
that particular workbook. If they don't have the modified preferences file, they can't use the
color information for any new color encoding.
To allow new color encoding using the custom color palette or to standardize a custom color
palette for the Tableau workbooks in your organization, you can create the custom color
palette using one of the options above, and then publish it as a Tableau Server data source.
1. On the same computer from which you modified the Preferences.tps file, open
Tableau Desktop.
2. Open the Superstore - Sample data source.
3. Right-click a field in the Data pane, and select Default Properties > Color.
4. In the Edit Colors dialog box, associate the field values with the custom color palette,
and then click OK when finished.
5. From the Data menu, select the data source, select Publish to Server, and then
complete process to publish the data source.
After publishing the data source to Tableau Server, connect any new workbooks to this data
source to use the custom color palette.
Totals in Tableau:
Add Totals in Tableau is the easiest thing in Tableau.It’s just a matter of check marks. In this
session we will show you, How to add totals in Tableau and this includes adding Row Totals,
Column Totals, Grand Totals and Subtotals with example.
We are going to add totals to below shown report. If you observe the below screenshot, it was
just a normal table report.
To add Totals in Tableau, go to Analysis Menu and select Totals and check mark the required
option. For instance, to display Rows total we have to select Show Row Grand Totals Option.
Once you select Show Row Grand Totals Option, an extra Grand Total column will be added
with all the row totals as shown below
In order to display the Column totals, go to Analysis Menu and select Totals and check mark
the Show Column Grand Totals Option as shown below
Once you select Show Column Grand Totals Option, an extra Grand Total row will be added
with all the column totals. If you observe the below screenshot, we rounded 29,358,677
because it is the Super Grand Total of all products.
Now, let us see how to add subtotals in tableau or simply, totals of nested regions. To explain
this, we removed Country names from column card and added it to rows card
To add Subtotals in Tableau, go to Analysis Menu and select Totals and check mark the Add All
Subtotals Option.
Once you select Add All Subtotals Option, an extra Total row will be added in the nested region
to display the column totals.
To remove Row Grand Totals and Column Grand Total, go to Analysis Menu and select Totals
and uncheck the corresponding option. To remove Subtotals in Tableau, we have to
select Remove All Subtotals Option as shown below