How to Join Two Columns in Tableau

Cody Schneider8 min read

Combining two or more columns in Tableau is a fundamental skill for creating cleaner, more informative visualizations. Whether you need to create a full name from separate first and last name fields or a unique ID from multiple data points, Tableau’s calculated fields make this process straightforward. This tutorial provides a step-by-step guide to joining columns, handling different data types, and using a few advanced tricks to clean up your results.

Why Combine Columns in Tableau?

Before jumping into the "how," let's quickly cover the "why." Joining columns, also known as concatenation, isn't just for cleaning data, it's a powerful way to add context and clarity to your dashboards. Common scenarios include:

  • Creating Full Names: Your data source likely has "First Name" and "Last Name" in separate columns. Joining them into a single "Full Name" field makes labels, tooltips, and tables much easier to read.
  • Building Full Addresses: You can combine "Street Address," "City," "State," and "Zip Code" into a single, comprehensive address string for contact lists or map tooltips.
  • Generating Unique IDs: Sometimes you need to create a unique identifier that doesn't exist in your original data. You could combine an "Order ID" with a "Product SKU" (e.g., "1001-TSHIRT") to create a unique key for each line item.
  • Creating Descriptive Labels: You can combine a text label with a value from a field to make your charts more descriptive. For example, instead of just having a product category name, you could create a label that reads "Category: Apparel."

The core method for all of these scenarios is the same: creating a calculated field. Let's walk through how to do it.

The Easiest Method: Joining Two Text Columns

The most common use case for joining columns is when you are working with two text fields, also known as strings. Tableau makes this incredibly simple using the plus (+) operator within a calculated field.

Let's use the classic example of combining a "First Name" and a "Last Name" column to create a "Full Name."

Step 1: Create a New Calculated Field

First, open your Tableau workbook and connect to your data source. In the Data pane on the left, find the fields you want to combine. Then, right-click anywhere in the Data pane and select Create Calculated Field...

Alternatively, you can go to the top menu and select Analysis > Create Calculated Field...

Step 2: Name Your New Field

A dialog box will appear. The first thing you should do is give your new field a descriptive name. In this case, let's call it "Full Name." This is the name that will appear in your Data pane once you're done.

Step 3: Write the Concatenation Formula

Now, it's time to write the formula. To join two fields, you simply list them with a + sign in between. Fields in Tableau formulas are always enclosed in square brackets []. So, for our "First Name" and "Last Name" fields, the initial formula looks like this:

[First Name] + [Last Name]

If you dragged both customer names into a view now, you would see "JohnSmith," "JaneDoe," etc. It works, but it’s missing a space. To add a space (or any other character), you just need to add it into your formula as a string surrounded by quote marks.

The corrected formula, which adds a space between the names, is:

[First Name] + " " + [Last Name]

The " " tells Tableau to insert a space character between the value from the [First Name] field and the value from the [Last Name] field. You could also put a comma and a space (", ") or any other separator inside the quotes.

Once you've entered your formula, the small note at the bottom of the dialog box should say "The calculation is valid." Click OK.

Step 4: Use Your New Field

You will now see your new "Full Name" field appear in the Data pane, usually under the "ABC" section for string fields. You can drag and drop this field into your view just like any other field.

Now, instead of managing two separate columns for names, you have one clean "Full Name" column that you can use for labels, filters, and axes on your charts.

Handling Different Data Types: Text and Numbers

What happens when you want to join a text column with a number column? For example, you might want to create a label like "Order ID: 10563," where "Order ID: " is a string and "10563" is a number from an [OrderID] field.

If you try to write the formula like this:

"Order ID: " + [OrderID]

Tableau will show you an error: "Can't add string and integer values."

This happens because Tableau doesn't automatically know how to combine two different data types. You need to explicitly tell it to treat the number as a piece of text. You can do this with the STR() function, which converts a value into a string.

The correct formula is:

"Order ID: " + STR([OrderID])

The STR() function wraps around the [OrderID] field, converting its numeric value into a string before Tableau attempts to join it with the "Order ID: " prefix. This same logic applies to other data types, such as dates and booleans (True/False values).

Example: Joining a Date Column with Text

Let's say you want to create a label that says "Order placed on: 2023-10-27." You would use the STR() function to convert the [OrderDate] field to text:

"Order placed on: " + STR([OrderDate])

Without the STR() function, Tableau would give you a data type mismatch error. It's a simple but vital function for combining different types of data into a single, clean column.

Advanced Tips for Cleaning Up Joined Columns

Once you've mastered the basics, here are a few extra functions and techniques that can make your combined fields even cleaner and more useful.

Handling NULL Values with IFNULL()

What happens if one of your columns contains a NULL (empty) value? For instance, what if a contact is missing a last name? When you try to join [First Name] + " " + [Last Name], the entire result will be NULL. This is usually not what you want.

The IFNULL() function is a lifesaver here. It checks if a field is null and, if it is, replaces it with a value you specify. To avoid null results, you can replace any null name fields with an empty string ("").

IFNULL([First Name], "") + " " + IFNULL([Last Name], "")

With this formula, if [First Name] is "John" and [Last Name] is NULL, the result will be "John " instead of just NULL. This formula is much more robust for datasets with missing values.

Removing Extra Spaces with TRIM()

Sometimes your source data has unwanted leading or trailing spaces. For example, a name might be stored as " John " instead of "John". These extra spaces can make your joins look messy and break sorting or filtering logic.

The TRIM() function removes spaces from the beginning and end of a string. To create a cleaner joined field, you can wrap each field in TRIM():

TRIM([First Name]) + " " + TRIM([Last Name])

This ensures that excess spaces in your original data don't appear in your final, joined column, keeping your Viz tidy and professional.

Creating Multi-Line Labels

You're not limited to a single line. This is especially useful for tooltips, where you might want to show an address on multiple lines to make it more readable. You can insert a line break into your calculated field using the CHR(10) function. CHR(10) is the ASCII code for a "new line character."

Imagine you have [City], [State], and [Country] columns. To display them on separate lines within a tooltip, you could use this formula:

[City] + ", " + [State] + CHR(10) + [Country]

When you drag this new field to the "Tooltip" shelf on the Marks card, the tooltip will display the location information stacked neatly on separate lines, like:

New York, NY United States

Final Thoughts

Joining columns is an essential skill for anyone working in Tableau, turning raw, separated data into contextual, readable labels and dimensions for your dashboards. By mastering calculated fields with the + operator and the STR() function for handling different data types, you can significantly enhance the usefulness of your visualizations.

At the end of the day, moving from raw data to real insights should be as frictionless as possible. We built Graphed because we believe the process of connecting data, creating reports, and exploring insights shouldn't require you to become an expert in formula syntax or data prep. Instead of building these calculations manually, you can simply ask for what you need in plain English, and our AI data analyst builds the dashboards for you, letting you focus on the insights - not the configuration.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.