KNOWLEDGE BASE

Modifying Field Names to Match a Field from Secondary Data Source


Published: 01 Aug 2019
Last Modified Date: 18 Oct 2019

Question

How to update primary data source fields so that they match a field in the secondary data source.

Primary data source data

Row NumberRegion1Region2Region3
1123
2456
3789

Secondary data source data

IDRegion
1USCA
2EMEA
3APAC


For example in the primary data source, the fields Region(1, 2, 3) described ABPVE, should match the Region field from the secondary data source; the below table would be the desired result. 

Row NumberUSCAEMEAAPAC
1123
2456
3789

Environment

Tableau Desktop

Answer

The below steps can be reviewed in the attached sample workbook Pivot Fields.twbx.
  1. From the Data Source pane, Pivot Region1 Region2 Region3
  2. Create a left join with the secondary data source, with clause as below
    1. For the Primay Data Source: click Join calculation and enter a formula similar to: INT(SPLIT([Pivot Field Names],'Region',2))
    2. For the Secondary Data source: select ID.
  3. Create a new sheet.
  4. Drag Region to Columns and Row Number to Rows
  5. Sort Region by Average([ID])
Did this article resolve the issue?