Popular Searches
Popular Course Categories
Popular Courses

Introduction to Data Preparation

Introduction to Data Preparation

Data Preparation and Management

Introduction to Data Preparation in Tableau

Data preparation is an essential step in Tableau that involves organizing, cleaning, transforming, and validating raw data before using it for analysis and visualization. Properly prepared data helps users create accurate dashboards, meaningful charts, reliable reports, and useful business insights.

Learn more: JustAcademy Tableau Training | Register for a Tableau Course Demo


1. What Is Data Preparation?

Data preparation is the process of converting raw data into a structured, consistent, and analysis-ready format. Data may come from Excel files, CSV files, databases, cloud platforms, or multiple sources. Before analyzing it, you may need to remove errors, correct data types, handle missing values, rename fields, and organize the structure.

In Tableau, data preparation can be performed on the Data Source page in Tableau Desktop and through more advanced workflows in Tableau Prep Builder.

Example

Suppose a sales report contains customer names, product names, sales amounts, order dates, and regions. The data contains blank rows, inconsistent region names, and sales values stored as text. Before building a sales dashboard, you should correct these issues so Tableau can interpret the information properly.

2. Why Is Data Preparation Important?

  • Improves accuracy: Reduces incorrect values and inconsistencies in analysis.
  • Improves data quality: Helps identify missing, duplicated, or invalid records.
  • Supports correct calculations: Ensures numeric and date fields are interpreted correctly.
  • Makes data easier to understand: Clear field names and consistent categories improve readability.
  • Combines information: Allows related datasets to be joined or unioned when appropriate.
  • Improves visualization: Well-structured data makes charts and dashboards easier to build.
  • Saves time: Resolving common data issues early reduces troubleshooting during analysis.

3. Common Data Preparation Tasks

Task Description Example
Data cleaning Correct or remove invalid and inconsistent values. Standardize region names.
Handling missing values Investigate blank or null fields and decide how to handle them. Identify missing customer regions.
Removing unnecessary fields Keep relevant columns and remove unused fields. Remove an irrelevant internal note column.
Renaming fields Use clear and meaningful column names. Rename SalesAmt to Sales Amount.
Changing data types Assign the appropriate data type to each field. Convert Order Date to Date.
Filtering records Keep only records needed for the analysis. Filter orders to a particular year.
Splitting fields Separate multiple pieces of information stored in one field. Split a full name into first and last names.
Pivoting data Reshape data from columns to rows or vice versa. Convert monthly sales columns into month and sales fields.
Joining data Combine columns from related tables using matching fields. Join orders with customer details.
Unioning data Append rows from similarly structured tables. Combine sales records from two years.

Tableau provides data-source preparation features, while Tableau Prep provides a visual workflow for more extensive cleaning and shaping operations. Read Tableau's official guide to setting up data sources.

4. Understanding Data Structure

A well-structured dataset usually has one header row containing field names, with each subsequent row representing a record and each column representing a field or attribute.

Example of an unstructured dataset

Sales Report - 2026
Company Monthly Sales Summary
Region | January | February | March
North  | 10000   | 12000    | 15000
South  | 8000    | 9000     | 11000

This layout may be readable for a person, but the months are stored as separate columns. For some analyses, a column-based structure with one row per region and month is more flexible.

Example of a structured dataset

Region,Month,Sales
North,January,10000
North,February,12000
North,March,15000
South,January,8000
South,February,9000
South,March,11000

This structure makes it easier to place Month on a chart axis, Region on Color, and Sales on Rows in Tableau.

5. Connecting to Data Before Preparation

Before cleaning data, connect Tableau to the required data source.

  1. Open Tableau Desktop.
  2. Locate the Connect pane on the start page.
  3. Select the required connector, such as Microsoft Excel, Text File, or a database connector.
  4. Choose the file or enter the required connection details.
  5. Select the relevant sheet or table and add it to the Data Source canvas.
  6. Review the data preview, field names, and data types.
  7. Begin cleaning and organizing the data before creating worksheets.

The available preparation options depend on the connector, the Tableau product, and the data structure.

6. Cleaning Data in Tableau

Data cleaning helps make data consistent and suitable for analysis. Tableau Desktop offers basic data-source preparation features, and Tableau Prep provides additional visual cleaning operations.

Common cleaning operations

  • Remove unnecessary fields.
  • Rename unclear column headings.
  • Correct inconsistent category values.
  • Filter irrelevant records.
  • Identify and investigate null values.
  • Correct data types.
  • Trim unwanted spaces from text values where supported.
  • Split combined fields into separate columns.

Example: Inconsistent region names

Suppose the Region field contains North, north, NORTH, and Noth. These values may represent the same region, but inconsistent spelling or capitalization can lead to confusing categories.

Original Value Possible Standard Value
North North
north North
NORTH North
Noth North, after confirming the intended meaning

Do not automatically replace values when the intended meaning is uncertain. Verify them against a trusted source before standardizing the data.

7. Understanding Data Types

Data types tell Tableau how to interpret a field. Selecting the correct type is important for calculations, filtering, sorting, and visualization.

Data Type Purpose Example
String Stores text values. Customer Name, Product
Integer Stores whole numbers. Quantity, Number of Orders
Decimal Number Stores numbers with fractional values. Sales, Profit, Discount
Date Stores calendar dates. Order Date
Date & Time Stores dates and time values. Order Timestamp
Boolean Represents true/false values. Is Active
Geographic Identifies location-related fields for mapping. Country, State, City

How to change a data type

  1. Open the Data Source page or a worksheet's Data pane.
  2. Locate the field that needs correction.
  3. Click its data type icon or open the field's menu.
  4. Select the appropriate data type.
  5. Review the resulting values and check for conversion problems.

Example: If Sales is interpreted as text, Tableau may not calculate its total correctly. Changing it to a numeric type can enable aggregation, provided the values are valid numbers.

8. Handling Missing and Null Values

A null value indicates that a value is missing, unknown, or unavailable. It is not always equivalent to zero or an empty text string.

Ways to handle missing values

  • Investigate why the value is missing.
  • Correct the value using a reliable source when possible.
  • Filter out records only when excluding them is justified.
  • Use an appropriate replacement only when its meaning is valid.
  • Keep null values when they represent genuine unknown information.

Example: If a sales record has a missing Profit value, replacing it with zero may incorrectly suggest that the transaction had no profit. First determine whether zero is a valid interpretation.

9. Filtering Data

Filtering reduces the data included in an analysis by selecting relevant records or values. It can help focus a report on a particular period, region, category, or business condition.

Examples

  • Keep sales records from 2026.
  • Display only the West region.
  • Exclude test transactions after confirming they are not genuine business records.
  • Focus on a selected group of products.

General workflow

  1. Identify the field that needs filtering.
  2. Select the required values or define the filter condition.
  3. Apply the filter using the available data-source, worksheet, or Tableau Prep options.
  4. Check that important records have not been removed unintentionally.

10. Splitting Fields

Splitting a field separates combined information into multiple fields. This is useful when one column contains several distinct pieces of information.

Example

Full Name
Amit Sharma
Neha Verma

After splitting the field, the data could look like this:

First Name,Last Name
Amit,Sharma
Neha,Verma

In supported Tableau data sources, use the field menu and select the split or custom split option. Choose the appropriate separator and verify the output, especially when names or values contain multiple spaces or separators.

11. Pivoting Data

Pivoting changes the layout of a dataset. It is particularly useful when repeated categories such as months or quarters are stored in separate columns.

Before pivoting

Region,January,February,March
North,10000,12000,15000
South,8000,9000,11000

After pivoting

Region,Month,Sales
North,January,10000
North,February,12000
North,March,15000
South,January,8000
South,February,9000
South,March,11000

For supported data sources, select two or more columns in the Data Source grid, open the column menu, and choose Pivot. Tableau creates fields such as Pivot Field Names and Pivot Field Values, which you can rename as needed.

Read the official Tableau guide to pivoting data.

12. Combining Data Sources

Sometimes the required information is stored in multiple tables or files. Tableau supports different approaches to combine or work with data from multiple sources.

Method Meaning Example
Join Combines columns from related tables using matching fields. Orders joined with Customer ID details.
Union Appends rows from similarly structured tables. January sales rows combined with February sales rows.
Relationship Defines a logical relationship between tables while allowing Tableau to determine how to combine data for a view. Orders related to Customers through Customer ID.
Data blending Combines aggregated results from separate data sources in a worksheet. Comparing sales from two separate sources.

Choose the method based on the structure and purpose of the data. Check matching keys, duplicate records, and row counts after combining tables because an incorrect join can change totals.

13. Using Data Interpreter

Data Interpreter is a Tableau feature that can help clean certain supported spreadsheet and file formats by identifying titles, notes, empty rows, footers, and other formatting that is not part of the actual table.

General steps

  1. Connect to a supported data source, such as an Excel or CSV file.
  2. Open the Data Source page.
  3. If the option is available, enable Use Data Interpreter.
  4. Review the interpreted table and available results.
  5. Verify the field names, headers, and data records.
  6. Perform any additional cleaning required before analysis.

Data Interpreter does not replace the need to review the results. Availability depends on the data source and its structure.

Read the official Data Interpreter guide.

14. Tableau Desktop vs. Tableau Prep for Data Preparation

Feature Tableau Desktop Tableau Prep
Primary purpose Prepare a data source and create visual analysis. Build visual workflows for cleaning and shaping data.
Basic cleaning Available for supported data sources. Provides a range of cleaning operations in flows.
Data combining Supports relationships, joins, unions, and other data-source options. Provides visual steps for joins, unions, and related operations.
Complex workflows Suitable for basic preparation within an analysis workflow. Useful for repeatable, multi-step preparation workflows.
Typical result A data source used for worksheets and dashboards. A prepared output dataset or published data source.

Use Tableau Desktop for straightforward preparation and analysis. Consider Tableau Prep when data needs extensive cleaning, reshaping, or a reusable sequence of preparation steps.

Read the official Tableau Prep cleaning guide.

15. Best Practices for Data Preparation

  • Keep an unchanged copy of the original data when possible.
  • Understand what each row and column represents before transforming the dataset.
  • Use clear and descriptive field names.
  • Confirm the correct data type for each field.
  • Investigate null values rather than replacing them automatically.
  • Standardize categories only after confirming their meaning.
  • Choose joins, relationships, and unions based on the data structure.
  • Review row counts and totals before and after transformations.
  • Check for unexpected duplicates and missing records.
  • Document important preparation steps so others can understand the workflow.
  • Validate the final data using sample records and known totals.

16. Practical Exercise: Prepare a Sales Dataset

Objective: Prepare a sample sales dataset for analysis in Tableau.

Sample raw data

Order ID Order Date Region Product Sales
101 2026-01-05 North Laptop 50000
102 2026-01-10 north Mobile 20000
103 2026-02-12 South Tablet 15000
104 2026-02-15 West Monitor  

Tasks to complete

  1. Connect the sample data to Tableau Desktop.
  2. Confirm that Order ID is interpreted as an identifier and Sales as a numeric field.
  3. Confirm that Order Date is recognized as a date.
  4. Investigate whether North and north should be standardized as the same region.
  5. Review the missing Sales value for Order ID 104 and decide how to handle it.
  6. Check for duplicate order IDs and unexpected records.
  7. Create a worksheet that shows total sales by region after the data has been validated.
  8. Compare the resulting totals with the cleaned records to confirm the chart is accurate.

Expected learning outcome

After completing the exercise, you should understand how to connect to a dataset, inspect field types, identify data-quality problems, standardize values when justified, and prepare data for a basic Tableau visualization.

17. Common Data Preparation Problems and Solutions

Problem Possible Cause Suggested Action
Sales cannot be aggregated as expected. Sales values may be stored as text or contain invalid characters. Inspect the values and correct the data type or invalid entries.
Dates appear incorrectly. Inconsistent date formats or incorrect type detection. Verify the date format and convert the field appropriately.
One region appears multiple times. Inconsistent spelling, capitalization, or spacing. Review and standardize values after confirming they represent the same region.
Sales totals increase after a join. Duplicate keys or a one-to-many or many-to-many join. Inspect the join keys and compare row counts and totals before and after joining.
Some rows are missing. Filters, join conditions, or source data issues may exclude records. Review filters, join types, and the original source.
Headers or titles appear as data. The source file may contain decorative headings or extra rows. Review the table structure and consider Data Interpreter where supported.

18. Interview Questions and Answers

Q1. What is data preparation in Tableau?

Data preparation is the process of cleaning, organizing, transforming, and validating data so that it is suitable for analysis and visualization in Tableau.

Q2. Why is data preparation necessary?

It improves data quality, helps prevent misleading results, supports correct calculations, and makes analysis easier to understand.

Q3. What is data cleaning?

Data cleaning involves identifying and addressing problems such as inconsistent values, invalid entries, missing data, and unnecessary fields.

Q4. What is the difference between a join and a union?

A join combines related tables horizontally by matching fields, while a union appends rows from tables with compatible structures.

Q5. What is pivoting in Tableau?

Pivoting reshapes data by converting selected columns into rows or changing a crosstab layout into a structure that is easier to analyze.

Q6. What is a null value?

A null value indicates that information is missing, unknown, or unavailable. It should not automatically be treated as zero.

Q7. What is Data Interpreter?

Data Interpreter is a Tableau feature that helps identify and exclude extraneous formatting, such as titles, notes, and empty rows, from supported data sources.

Q8. What is the difference between Tableau Desktop and Tableau Prep?

Tableau Desktop supports data-source preparation and visual analysis, while Tableau Prep is designed for visual, multi-step data-cleaning and shaping workflows.

Q9. Why are data types important?

Data types determine how Tableau interprets fields and affect operations such as aggregation, date handling, filtering, and geographic mapping.

Q10. How can you validate prepared data?

Review field types, missing values, duplicates, row counts, join results, and known totals. Compare the prepared dataset with the original source when possible.

19. Revision Checklist

  • Understand the meaning and purpose of data preparation.
  • Recognize common data-quality issues.
  • Inspect the structure of a dataset.
  • Connect data to Tableau Desktop.
  • Identify and correct field data types.
  • Handle missing values carefully.
  • Clean inconsistent text values.
  • Filter irrelevant records.
  • Split and pivot fields when needed.
  • Understand relationships, joins, and unions.
  • Know when to use Data Interpreter and Tableau Prep.
  • Validate the final dataset before building dashboards.

20. Useful Learning Resources

Conclusion

Data preparation is a foundational Tableau skill. By cleaning values, correcting data types, handling missing information, filtering records, reshaping tables, and combining data carefully, you can create a reliable foundation for analysis. Always validate the prepared dataset before building charts, reports, or dashboards so that your insights are based on trustworthy information.

Continue learning with JustAcademy Tableau Training or Register for a Tableau Course Demo.

whatsapp