Tableau Tips: Dates by Week

Tableau handles the use of dates organized by week different from day, month, year.  To bring some control and transparency to the process of handling dates, using custom date functions to organize data into buckets based on week and then processing to show the date brings that power back to the analyst.

Using the default week numbers limits the formatting options and presents the data without tangable represntations of when the week occured.  

Pretty sparse, right?  In my expereince, it's been rare to have this be sufficent for meanfingul data viszualiations.  

Using Tableau to break the data out by week and trying to format to a readable date format is confusing and obfuscates the process.  I've found that a custom date field brings transparency and control back to the grouping of data by weeks by using the following method.  

By using this simple formula it is possible to group data in a viz by week and then use Tableau's formatting to make modifications to the way the date is presented.   

To accomplish this, use the DATEADD() and DATETRUNC() function.  

DATE(DATEADD('day',6,DATETRUNC('week',[Work Date])))

How this function works:

Right click the pill and select Exact Date and Discrete. 

Now that the date has been formatted, your graph is readable and organized by weeks!

Let's Talk Data - #DataFam Discord

Let's Talk Data - #DataFam Discord

#WorkoutWednesday 2018 Week 52

#WorkoutWednesday 2018 Week 52