• Skip to primary navigation
  • Skip to main content
Antichaos

Antichaos

Tableau, Data Analyse & Visualisatie

  • Home
  • Consultancy
  • Training
  • Blog
  • Showcase
  • About Me
  • Newletter
  • Contact
  • Show Search
Hide Search

ISO weeks in Tableau

Johan de Groot · 30 June 2017 ·

Tableau can handle all kind of dates and dateformats very well – but one option is lacking: the use of ISO8601 weeknumbers, the one which is used all over the world, especially in Europe. 

This formula will generate the right ISO weeknumber for you:

INT((Datepart('dayofyear', 
(dateadd('day',
INT(datediff('day', #1900-1-01#, [Date])/7)*7 
+ 3,#1900-1-01#))) + 6)/7)

Tableau Desktop interprets 12/31/2017 as week 53 of 2017 instead of week 1 for 2018 (per the ISO 8601 standard) – therefore you need to ‘compensate’ the year also:

If datepart('week',[Date])=53 
THEN datepart('year',[Date])+1 
ELSE datepart('year',[Date]) end

(if you want to have this resolved in Tableau itself: please vote for this must have feature on https://community.tableau.com/ideas/2992 UPDATE: this feature has been implemented in Tableau!

Related posts:

Top 2000 – 2018 Default ThumbnailUse Python as an Alteryx connector Default ThumbnailCalculate last day of month Use Python as an Alteryx connector

blog

Need help?

Contact me if you need Tableau help on development, implementation or training!
contact@antichaos.net

The Antichaos Update

Like what you’re seeing? Let’s stay in touch!

(The Antichaos update is a short, infrequent newsletter on data, Tableau, usability and more!)

Follow me on LinkedIn

Follow me (and connect!) on LinkedIn to stay up-to-date. Connect on LinkedIn

Antichaos

Copyright © 2025