EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

Concatenate in Tableau

By Priya PedamkarPriya Pedamkar

Home » Data Science » Data Science Tutorials » Tableau Tutorial » Concatenate in Tableau

concatenate in tableau

Introduction to Concatenate in Tableau

The concept of Concatenation essentially refers to the fact that multiple fields can be combined together in order to serve a particular context-based purpose. Often strings are combined in order to form another string that will convey some meaning. The use of concatenation in Tableau may be considered different than that of any programming language. In Tableau, concatenate is generally applied in cases when two or more fields are to be combined to form another field. This combined field will have some meaning in itself.

Syntax:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

The concatenation in Tableau can be done using the ‘+’ operator. The syntax for concatenation in Tableau is as follows.

string_1 + string_2 + string_3…+ string_n

The concatenated field created using the above syntax will be a calculated field in Tableau.

How to use Concatenate in Tableau?

For this demonstration, we are going to use the Distribution Unit Volume dataset which contains volume distributed across various cities in India. The hierarchy of distribution area is Regions -> Distribution Unit -> City. Important dimensions are the Distribution Unit and Region, while the Distribution Volume is a measure. We’ll demonstrate the concept of concatenate and its application using this dataset as described in the following section.

1. First load the dataset. For that click on “New Data Source” under Data Menu as shown below.

Concatenate in Tableau-1.1

2. In the Connect section select the requisite data source type. In this case, it is clicked on “MS Excel”, so click on “Microsoft Excel” as shown below.

Concatenate in Tableau-1.2

3. The data gets loaded and can be seen in the Data Source tab as shown below.

Concatenate in Tableau-1.3

4. Moving to the sheet tab, we can see the dimensions and measures present in the requisite sections as can be seen in the following screenshot.

Concatenate in Tableau-1.4

5. To begin with, bring Region and Distribution Unit dimensions into Rows region and drag Distribution Volume measure over Text in Marks card. As a result of this action, we get a table giving Distribution Unit wise Distribution Volume for different regions. This is as shown in the following screenshot.

Concatenate in Tableau-1.5

6. We created a column chart over the above table, which is as shown below. If we go through it, we can find that a regional breakup is making the appearance messy. What if we bring another dimension into the analysis? The analysis shall then become too complex to derive any insights.

Concatenate in Tableau-1.6

7. As mentioned above, we brought another dimension i.e. Mode into the analysis, as shown below. Now, we can find that the analysis has become complicated. Our intention is to visualize the Distribution Unit wise Distribution Volume for different regions for each of the modes. However, it seems, using this approach we may not be able to derive any insights properly.

Popular Course in this category
Tableau Training (4 Courses, 6+ Projects)4 Online Courses | 6 Hands-on Projects | 39+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (6,121 ratings)
Course Price

View Course

Related Courses
Business Intelligence Training (12 Courses, 6+ Projects)Data Visualization Training (15 Courses, 5+ Projects)

Concatenate in Tableau-1.7

8. Now, in order to overcome the issue of complexity, we can use the concatenation functionality provided by Tableau. Using this functionality, we will combine three dimensions or fields viz. Distribution Unit, Region and Mode in this order. The combined field will act as a unique field and work as a single field. Working with and deriving insight through this single field is a lot easier than using multiple fields together. We can create a combined field through the “Create Calculated Field” option. Click anywhere in the blank space in the Data tab, and click on “Create Calculated Field” as illustrated in the following screenshot.

Concatenate in Tableau-1.8

9. When we follow the above step, the calculated field pane pops-up as shown below. The default name for the field is “Calculation1”.

Concatenate in Tableau-1.9

10. Rename the field as “Combined Field” as shown below. An appropriate name should be provided to the field that should convey meaning. When done, click on Apply and then on OK.

Combined Field-1.10

11. Now, the next step is to bring the dimensions one-by-one. We will create the field of the type [Distribution Unit]_[Region]_[Mode]. E.g. if the Distribution Unit in Ahmedabad, its region i.e. West, and the Mode is L2, then the Combined Field value would be Ahmedabad_West_L2. In this way, all the field values should get generated. The following screenshot shows the Distribution Unit dimension being dragged into the calculated field.

Distribution Unit-1.11

12. Once the first dimension (Distribution Unit in this case) is brought then the next in the syntax is the ‘+’ operator. The string to be inserted between has to be specified in double-quotes. This is very important, otherwise, the field won’t get created and we shall get an error.

Concatenate in Tableau-1.12

13. Likewise, bring the rest two dimensions viz. Region and Mode into the calculated field, and using the syntax properly, create the field as shown in the following screenshot. Remember, if the syntax is implemented properly, then we get the “The calculation is valid” message in the right-hand bottom corner of the field. Observe carefully, each and every element in the following screenshot, and check how the syntax works.

Combined Field-1.13

14. The newly created field “Combined Field” can be seen in the left-hand side of the window, in the Dimensions section. This is as shown in the following screenshot.

Concatenate in Tableau-1.14

15. Just double click on the newly created calculated field “Combined Field” and it is brought into the Rows region. Next, drag Distribution Volume measure over Text in the Marks card. As we can see, in the following screenshot, we got the Distribution Volume value for each of the Combined Field values. The newly created field gives better insight into the data.

Combined Field-1.15

16. We will create a column chart over the above table, and observe carefully the analysis in the following screenshot. The analysis offers more clarity than the one we have created in the preceding section, which takes the Distribution Unit, Region and Mode as different dimensions.

Column Chart -1.16

17. Some of the dimension values in the above screenshot are not visible properly, so we just modified the above chart in the horizontal bar chart which is shown below. Now, the name appears properly.

Horizontal Bar Chart-1.17

The above visualization is an example of how we can employ the concatenate function in Tableau effectively to make the insight derivation process easy and efficient.

Conclusion

Tableau is a visual analytics tool that lays heavy impetus on employing visualizations to facilitate insight derivation. Though not being a programming tool, it does provide functionalities such as concatenation. The functionality of concatenation in Tableau is useful in various contexts, especially when combining multiple fields.

Recommended Articles

This is a guide to the Concatenate in Tableau. Here we discuss how we can employ the concatenate function in Tableau effectively to make the insight derivation process easy and efficient. You may also have a look at the following articles to learn more –

  1. String Functions of Tableau
  2. Map Layers in Tableau
  3. Dashboard in Tableau
  4. Tableau New Features
  5. Different Concepts of Tableau Action Filter

Tableau Training (4 Courses, 6+ Projects)

4 Online Courses

6 Hands-on Projects

39+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

1 Shares
Share
Tweet
Share
Primary Sidebar
Tableau Tutorial
  • Functions
    • Tableau Functions
    • Tableau String Functions
    • Concatenate in Tableau
    • Rank Function in Tableau
    • Tableau Aggregate Functions
    • Tableau Date Functions
    • Window Sum Tableau
    • LOD Expressions in Tableau
    • LOOKUP Function in Tableau
    • Tableau Fixed Function
    • Tableau Count Distinct
    • Tableau Window Functions
  • Basic
    • What is Tableau
    • What is Tableau Dashboard
    • What is Tableau Server
    • Uses of Tableau
    • Tableau Versions
    • Tableau Architecture
    • Is Tableau Free
    • Tableau New Features
    • How To Install Tableau
    • How to Use Tableau?
    • Install Tableau Server
    • Tableau Commands
  • Charts
    • Tableau Charts
    • Tableau Chart Types
    • Donut Chart in Tableau
    • Funnel Chart in Tableau
    • Gantt Chart in Tableau
    • Bubble Chart in Tableau
    • Pareto Chart in Tableau
    • Sankey Chart In Tableau
    • Stacked Bar Chart in Tableau
    • Tableau Bullet Chart
    • Waterfall Chart in Tableau
    • Line Chart in Tableau
    • Heat Map in Tableau
    • Histogram in Tableau
    • CrossTab in Tableau
    • Treemap in Tableau
    • Trend Lines in Tableau
    • Tableau Reference Lines
    • Tableau Dual Axis
    • Legend in Tableau
    • Pie Chart in Tableau
    • Tableau Storyline
  • Statement
    • Tableau IF Statement
    • Case Statement in Tableau
  • Sort/Filters
    • Sorting in Tableau
    • Filters in Tableau
    • Types of Filters in Tableau
    • Tableau Action Filter
    • Context Filter in Tableau
    • Tableau Parameter Filter
    • Adding Filters in Tableau Dashboard
    • Tableau Context Filter
  • Tableau Dashboard
    • Dashboard in Tableau
    • Tableau Dashboard Creation
    • Tableau Dashboard Design
    • Tableau Workbook
  • Advanced
    • Tableau Reporting
    • Tableau Reporting Tool
    • Conditional Formatting in Tableau
    • Data Blending in Tableau
    • Parameters in Tableau
    • Tableau Data Sets
    • Tableau Drill Down
    • Tableau Dynamic Parameters
    • Tableau Table Calculation
    • Tableau Visualization
    • Tableau Joins
    • Pivot in Tableau
    • Data Visualization With Tableau
    • Forecast in Tableau
    • Map Layers in Tableau
    • Group in Tableau
    • Tableau Group by
    • Hierarchy in Tableau
    • Sets in Tableau
    • How to create a Set in Tableau
    • Tableau Order of Operations
    • Tableau User Group
    • Tableau Calculated Field
    • Custom SQL in Tableau
  • Interview Questions
    • Tableau Interview Questions

Related Courses

Tableau Certification Course

Business Intelligence Courses

Data Visualization Courses

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Tableau Training (4 Courses, 6+ Projects) Learn More