6 min read
Data Cleaning in Tableau
Techniques for cleaning and preparing data in Tableau
Why Clean Data?
Dirty data = Wrong results. Always clean your data first!
Common Data Problems
- Missing values
- Wrong data types
- Duplicate rows
- Inconsistent names (NY vs New York)
- Extra spaces
Cleaning in Data Source Tab
1. Rename Columns
- Right-click column header
- Select "Rename"
- Type new name
2. Change Data Types
- Click data type icon
- Select correct type
3. Hide Unused Columns
- Right-click column
- Select "Hide"
4. Split Columns
For "John Smith" to "John" and "Smith":
- Right-click column
- Select "Split"
Using Data Interpreter
Tableau can auto-clean Excel files:
- Connect to Excel
- Check "Use Data Interpreter"
- Tableau removes headers, footers, etc.
Filtering Bad Data
Remove unwanted rows:
- Go to Data Source tab
- Click "Add" under Filters
- Set your filter conditions
Handling Nulls
Null = Missing value
Options:
- Filter out nulls
- Replace with 0
- Replace with average
To replace nulls:
- Create calculated field
- Use:
IFNULL([Field], 0)
Fixing Inconsistent Names
"USA", "U.S.A", "United States" should be same:
- Right-click the field
- Select "Aliases"
- Map different names to one value
Pivot Data
Convert columns to rows:
- Select columns to pivot
- Right-click
- Select "Pivot"
Good for:
- Months as columns → Months as rows
- Years as columns → Years as rows
Quick Cleaning Checklist
- Check data types
- Remove duplicates
- Handle missing values
- Fix inconsistent names
- Remove unnecessary columns
Summary
Clean data before analyzing. Use Data Source tab for renaming, filtering, and fixing issues!