Check out the first Dataiku 8 Deep Dive focusing on Productivity on October 29th Read More

Total number of weeks in year

Level 1
Total number of weeks in year

Hi all,

How can I get a number of weeks in the year based on date?

0 Kudos
2 Replies
Dataiker
Dataiker

Hi @mikzielinski 

Just to confirm I understand correctly. Are you looking for:

  1. The number of weeks in a year, given a year as a parameter? This would be equivalent to asking whether a year is a leap year.
  2. Given a date, compute the week within the year that that date falls on. This would return an integer.

Let me know!

 

0 Kudos
Level 1
Author

I manage to get this,

From the date I got the current week number, then I created a fake date on last week of the year. After that, I subtracted them and got weeks until the end of year 🙂