How to Find the Correlation for an Aggregated Value in Tableau Using a Window Function

How do you find the correlation of two aggregated values in tableau in this example I have a scatter plot of kpi and kpi2 and I’m showing the correlation of 0.07 they are both aggregated values let’s take a look at how to do this in tableau. If this is your first time here make sure you like And subscribe for more Tableau content now that I have a scatter plot built let’s write a correlation function add a new calculated field. We’ll call it correlation. I’m just going to write the core function and pass in kpi and kpi2. You’ll see that I get an error of course because core cannot take two aggregates that’s a Justice correlation function and type window in front of it. So the window correlation of kpi and kpi2 which is a table calculation and I have this calculation is valid click apply okay.drag correlation into the view onto detail and I’m going to edit this calculation to make sure it’s indexed right and click the drop down edit table calculation. And make sure that it’s indexing in the right way I want Tableau to take the correlation along the entire table if you were to uncheck either of these it would be for each unchecked item so if I wanted the correlation to be done for each project product I could by unchecking product clear that out go up to our title. And let’s put in my correlation field. And make it Orange. And I see that my correlation is .07 hope this helps.