KNOWLEDGE BASE

## Creating a Correlation Value Matrix

Published: 15 Aug 2017

### Question

How to create a correlation value matrix in Tableau Desktop.

### Environment

• Tableau Desktop 10.3.1
• Mac OS
• Excel

The below examples of calculated fields are based on the attached workbook Correlaton Value Matrix.twbx. The data source pane will show that a self join is applied.

### Step 1 - Create a Calculated Field for the Correlation

1. Select Analysis > Create calculated field
2. Name the field "CORR Value", enter the following formula and click OK
`CORR([Value1],[Value2])`
3. In the attached workbook, Value1 = Product1 and Value2 = Product2

### Step 2 - Create a Calculated Field to filter the Value

1. Select Analysis > Create calculated field
2. Name the field "Product Filter", enter the following formula and click OK
`[Value1]<>[Value2]`
3. In the attached workbook, Value1 = Product1 and Value2 = Product2

### Step 3 - Build the View

1. Drag [Value1] to Columns.
2. Drag [Value2] to Columns.
3. Drag the Calculated Field "CORR Value" to Color and Text
4. Change the Mark type to Square
5. Drag the the Calculated Field "Product Filter" to Filter and select True