[go: up one dir, main page]

0% found this document useful (0 votes)
7 views24 pages

Hands-On-Session - Customize A Data Source

Uploaded by

jhanvibajpai07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views24 pages

Hands-On-Session - Customize A Data Source

Uploaded by

jhanvibajpai07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

6/28/2025

Customizing Data
Source

1
6/28/2025

Customizing Data Source


• Do you want to be able to customize metadata just once, like renaming a
field so that it aligns with business usage, and save those changes for future
use?
• How to revise the properties of a data source and save those customizations
in a Tableau data source (.tds) file so that you can keep working with your
data without losing your changes and even share the changes with others?
• Do you have a data source that updates frequently?
• How do changes to a data source affect your visualizations?

2
6/28/2025

Customize a Data Source

3
6/28/2025

Customize a data source


• When analyzing data, you may need to do some clean-up and organization as
you work with the underlying source data.
• This could include customizations like connection information,
organizational or metadata changes, attributes, or aliases.
• Note that Tableau preserves the customizations you make, but it does not
change the underlying source data.

4
6/28/2025

Work with metadata


• Metadata is information about the data, like field name or
data type, or default aggregation.
• It’s possible to edit the metadata from several places, but
in this module, we’ll focus on editing in the worksheet.
• Common changes to data attributes fall into several
categories, all of which are saved in a Tableau data source
(.tds) file:
• Folder structure
• Measure and dimension conversions
• Field data types (e.g., strings, integers, dates)
• Field properties (e.g., how a field is displayed or
aggregated)
• Attributes (e.g., field names)

5
6/28/2025

Organize fields into folders


• When you have a large number of fields in the Data pane,
it can be helpful to organize dimensions and measures into
a more efficient folder structure.
• For example, you may want to organize all the customer
fields, such as Customer Name and Customer ID, into a
new folder called "Customer Info."
• To organize fields into folders:
• Click the Data pane menu and select Group by Folder.
• Right-click one of the fields you wish to add to the folder, point
to Folders, and select Create Folder.
• In the Create Folder dialog box, give the new folder a relevant name.
• Click OK.
• Drag the desired fields into the folder.
• To simplify the list of fields on display, click to open or close the
folder.

6
6/28/2025

Convert fields from measures to dimensions


• Tableau automatically predicts whether your fields
are dimensions or measures, but sometimes you
may want to re-categorize a dimension as a measure
or vice versa.
• This might happen when a numeric identifier field
gets categorized as a measure when you actually want
it to be a discrete dimension.
• For example, you may want to change the Row
ID field to a dimension if these aren’t numbers you
want to add up or average.
• To change a measure to a dimension, drag the
measure to the Dimensions area.
• Similarly, to change a dimension to a measure, drag
the dimension to the Measures area.

7
6/28/2025

Edit attributes
• Databases don’t always use human-readable titles or names that make sense to your
audience.
• To make the field names more intuitive, Tableau allows you to rename any of the
database fields.
• This is especially helpful when you are sharing a data source with other users.
• For example, if you want the name of the Country field to be Country/Region:
• Right-click the Country field and select Rename.
• Revise the field name. In this case, we’ll change it to “Country/Region”.
• Press Enter.

8
6/28/2025

Create aliases to rename members in the View


• To clarify the meaning of the labels associated with discrete dimension members in
the view, Tableau allows you to create aliases, or alternate names.
• For example, if you have a dimension Storm Name with a member named "Subtrop
1," you can create an alias to apply the actual storm name.
• You cannot create aliases for dates, measures, or the members of continuous
dimensions.
• To create an alias:
• In the Data pane, right click a dimension.
• Select Aliases.
• In the Edit Aliases dialog box, select the Member you want to edit.
• Type the new alias.
• Click OK.
• Notice that the Has Alias column now has a * to indicate that the member has an
alias.
• When you add the field to the view, the alias names will appear as labels in the view.

9
6/28/2025

Edit a field’s default properties


• You can edit a field’s default properties, such as color, number format.
• Every time you add the field to the view, it will maintain its assigned properties.
• For example, if you want the Sales field to default to currency with no decimals:
• Right-click the Sales field to open the menu.
• Go to Default Properties and select Number Format. The Default
Number Format [Sales] dialog box opens.
• Select Currency (Custom).
• Set the Decimal places to 0.
• Set the Display Units to Thousands (K).
• Click OK.
• Now, each time you build a viz with the Sales field, it will use its revised default
number format.
• In addition to Number Format, you can modify any of the other Default
Properties—Comment, Color, Aggregation, Total using, etc.—and save those
customizations in a .tds file.

10
6/28/2025

Save and open a Tableau Data


Source file

11
6/28/2025

Save and open a Tableau data source (.tds) file


• You may find yourself repeating the same
cleanup and organization steps each time you
work with a data source.
• Once you’ve made changes to the metadata,
you’ll want to save those customizations for
reuse.
• Tableau Desktop saves your customizations to a
local file in the Tableau data source (.tds)
format.
• You can reuse the .tds file in different
workbooks and share the .tds file with other
users.
• Locally saved Tableau data source (.tds) files
appear under Saved Data Sources, on
the Connect page.

12
6/28/2025

Save a Tableau data source (.tds) file locally


• To save a .tds locally:
• Open the Data menu.
• Hover over the current data source.
• Click Add to Saved Data Sources.
• The Add to Saved Data Sources dialog box
opens to the default location:
the Datasources folder under My Tableau
Repository.
• Enter a name for the .tds in the File name field.
• Click Save.
• Remember that saving the .tds to
the Datasources folder under My Tableau
Repository makes the .tds available from
the Connect page under Saved Data
Sources.

13
6/28/2025

Open a locally saved Tableau data source (.tds) file


• Saving a .tds in My Tableau Repository makes it easy to find
the next time you launch Tableau.
• To open a saved .tds:
• Launch Tableau or open a new window.
• Click Show Start Page (the Tableau logo) to view the Connect pane.
• Click the .tds.
• The data source opens with all of the metadata customizations
that you applied already in place, including organizing fields into
folders, changed data attributes, renaming fields, and changes to
default properties.

14
6/28/2025

Save a Tableau data source (.tds) file to Tableau Cloud or Tableau Server
• Not only does the .tds preserve your customizations, it also enables you to make
these changes available to others.
• You publish a .tds file from Tableau Desktop to Tableau Cloud or Tableau Server
to make it available to others.
• You can only publish according to your Server permissions.

15
6/28/2025

Update the view with new data


What happens when you are working with a data source that gets
updated?

16
6/28/2025

Tableau Data Conenctions


• A Tableau data connection can be Live data or an Extract.
• The default is for a live connection, which will refresh your data when you
open a workbook, or when you manually refresh.
• The other option is to work with a data extract, where Tableau makes a local
copy of a subset of your data.

17
6/28/2025

Refresh a viz to reflect new data


• The data that you use to build your vizzes might change from time to time, or even on a regular
basis.
• For example, let’s say you’ve built a viz that shows the number of living organ donors each year,
by age.
• This data will update each year, so it’s a great example of how Tableau handles changes to data.
• If you close and reopen the workbook, Tableau will automatically refresh the data
• You can also manually refresh the data. To do so:
• Right-click the data source.
• Select Refresh.

18
6/28/2025

Update field references


• Because we are using a live connection, Tableau is able to retrieve updates to
the data.
• However, there are some updates that Tableau can’t accommodate, like
changes to the structure of the dataset.
• If we rename or remove columns, Tableau will not understand these updates.
• When we refresh the data in Tableau, we see that the new data structure
breaks the viz. Tableau alerts us to the broken reference in several ways

19
6/28/2025

20
6/28/2025

Fixing the Visualization


• To fix the viz:
• Right-click the broken field in
the Data pane.
• Select Replace References.
• In the Replace References dialog box,
select the replacement reference. In this
case, the renamed field.
• Click OK.
• The viz updates with the replacement
reference and no longer shows any
errors.

21
6/28/2025

22
6/28/2025

Hands-On Activity

23
6/28/2025

Hands-On Activity
• You have a data source file with hurricane data.
• You want to customize and save the data source so you can reuse the customized version to
build additional workbooks in Tableau.
• Data file – Hurricane data – starter.twbx
• Activities to perform:
• Rename the Lat (deg) and Long (deg) fields to Latitude and Longitude, respectively.
• Convert the Category field to a dimension and change the default sort order to Descending.
• Set the geographic role for the Longitude field to Longitude.
• Save the customized data source and close Tableau.
• Reopen Tableau and then open the data source to confirm the changes were saved.

24

You might also like