I have the data below where Below is how the data looks like. Each D* refers to one of the three variables that are all correlated against each other. There are 3 instances of each D* variable. When the same variables are against each other in that case 'NA'.

D1  D1  D1  D2  D2  D2  D3  D3  D3
D1
D1
D1
D2  0.3 0.3 0.3
D2  0.4 0.2 -0.2
D2  0.1 0.3 0.4
D3  0.6 0.6 0.6 0.2 0.2 0.2
D3  0.6 0.8 0.9 0.4 0.2 -0.2
D3  0.7 0.7 0.7 0   0.2 0.2
I want to make a heatmap from this data where the correalation values (coefficients) are converted to colors. Step-by-step, what can I do to reformat or otherwise the data to achieve this?

Apr 2, 2018 in Tableau 2,759 views

## 1 answer to this question.

Step 1: Create an Excel Spreadsheet with the table exactly as you provided above (I have renamed the different D* instances with a, b and c as required) and save the excel spreadsheet.

Step 2: Open Tableau and connect to the Excel file

Step 3: Select columns D1a to D3c

Step 4: Hover your mouse and click on the drop down arrow and select pivot

Step 5: Double click on F1, Pivot field names and Pivot field values and rename as appropriate. Note the slight variations in the names.

Step 6: Change the data type for correlation coefficients. Click on Abc and change as shown. Click on Sheet 1 when you are done.

Step 7: Right click on Correlation Coefficients and click Convert to measure.

Step 8: Drag the different D* fields to the row and column shelves exactly as shown. Drag Correlation Coefficients onto the Color Marks card.

Step 9: Click on “Abc” at the top as shown. Hover your mouse and click on the drop down arrow and Edit colors.

Step 10: Choose the options shown below. Feel free to use this format if you wish.

Step 11: Click on the end member green color and select the lighter green color as shown. Deselect “Use Full Color Range”. Click OK.

Step 12: Format the Correlation Coefficients as shown.

Step 13: You just built your first Tableau visualization! Well done.

• 5,550 points

## How to use a IFF statement in Tableau

Use this syntax -  IIF(([Avg_sale] > [Today]),STR([Avg_sal ...READ MORE

## How can I add a connection between Mongodb and Tableau

What I want? Parse the XML to JSON ...READ MORE

## Multiple measures with heat map and text.

Hi Rajesh, Once you can create the table, ...READ MORE

## How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

## Calculated filed with if-then

Below is the required code:  IF (NOT ISNULL([test2])) ...READ MORE