2 Replies Latest reply on Mar 31, 2016 3:29 PM by Andrew Mohlmann

# Standard Deviation of a table calculation

I have some data that is essentially a list of public holidays in one column and the date they appear in another. Something like this:

DateName
01/01/2016New Year's Day
26/01/2016Australia Day
25/03/2016Good Friday

and so on.

To work out the amount of days between each public holiday I did a bit of a work around. I created a calculated field called "Date Reference" that is simply DATE(01/01/1999).

I then created a table with Year in the columns and Name in the Rows. Then I use a table calculation for the difference between each day running down the table. So far so good.

The problem now lies if I want to do some work on this data. For instance how can I see the Standard Deviation of the running difference between each day? How do I look at the average number of days wait between public holidays etc. because this data is already aggregated it will not allow me to make calculated fields using this information.

Thanks for helping out a newbie like me.

• ###### 1. Re: Standard Deviation of a table calculation

Howdy Andrew,

I pulled some dates of the internet for the holidays for the rest of the year. I've made a standard deviation that runs throughout the year and one that is set for the entire year. We use WINDOW functions for this as they allow us to use table calculations and base aggregations (which a standard deviation is) on on other aggregations (table calculations).  The attached workbook is in Tableau 9.0 and can be opened with any later edition.

Cheers!

Carl Slifer

InterWorks

• ###### 2. Re: Standard Deviation of a table calculation

This is perfect. The way you calculated the day difference is so much more elegant that the work around I was using. This answer is exactly what I am looking for.

Thank you very much.