KNOWLEDGE BASE

Comparing Matching and Non-Matching Records Across Blended Data Sources


Published: 03 May 2014
Last Modified Date: 05 Jun 2017

Question

How to compare blended data sources to classify matching and non-matching records.

Environment

  • Tableau Desktop
  • Data Blending
  • 2 Data Sources with Identical Data Structures

Answer

  1. Go to Analysis > Create Calculated Field.
  2. Name the calculated field and in the Formula field, enter the following:
    IF ATTR([<Primary Data Source Field to Compare>]) = ATTR([<Secondary Data Source Field to Compare>]) THEN 'Same' ELSE 'Different' END
  3. Click OK.
  4. Drag the calculated field to the Color shelf on the Marks card to create a view that shows which fields match and which fields are different between the two data sources.

Additional Information

For more accuracy, include more comparison clauses to represent more common fields between the two data sources. For example:
IF ATTR([<Primary Data Source Field to Compare>]) =
ATTR([<Secondary Data Source Field to Compare>]) 
AND
ATTR([<Second Primary Data Source Field to Compare>]) = ATTR([<Second Secondary Data Source Field to Compare>])
THEN 'Same' ELSE 'Different' END
Did this article resolve the issue?