Jump to content

ISO week in graph


Mathijs Hooisma

Recommended Posts

Last calender year had 53 weeks according to the ISO standard. The problem is now that I have a graph were the user can slice the x-axis from year-month-week-day.

On the webserver of our company Spotfire is splitting up ISO week 53 in two parts: the days which are in 2020 are in week 53 and the day in 2021 are in week 1. Next to this, the weeks in 2021 are now shifted by one week. Last week in the graph is now week 3while that should be week 2. And week 2 should be week 1.

On my personal laptop I have different time settings (week starts on sunday) and then week 53 is split in a week 53 part in 2020 and a week 53 part in 2021. Week 1 and 2 of 2021 are corrict in this set up.

My question is how we can solve this, preferably on both the web server and laptop settings. Something similar like the FiscalYearOffset property

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Another quite ungly workaround - calculate a "plot date" to use for the graph (note, you don't need all intermediate fields in below calculation)

3. Select Data > Transform data...

Added transformations

Transformation name: Calculate new column

Column name: Week

Expression: Week([Date])

Transformation name: Calculate new column

Column name: ISOweek

Expression: Integer(IsoDate('ww',[Date]))

Transformation name: Calculate new column

Column name: WeekDiff

Expression: case

when [Week]=[iSO week] then 0

when ([iSO week]=1) and ([Week]=2) and (Day([Date])

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...