Skip to main content
Nintex Community Menu Bar
Question

Week Number formula

  • June 27, 2024
  • 3 replies
  • 2 views

Forum|alt.badge.img+1

This is likely something obvious that I am overlooking, but how do you write a formula to get a week number from a date?

3 replies

Forum|alt.badge.img+1

I don’t see an easy method. You may have to get the date value of January 1st of the year of your target date, Then subtract that from your target date, then divide by 7 and round down.


Forum|alt.badge.img+1
  • Author
  • Known Participant
  • June 27, 2024

Thank you, I decided to calculate the value in a database query and load the value as a model so I can reference it. It isn’t the most elegant solution, but it works.


Forum|alt.badge.img+1
  • Inspiring
  • June 27, 2024

Sorry for not getting back to you sooner. Our “FormatDate” formula function gets you started with this concept. But it doesn’t have a “Week Number” option. (We’re gonna fix that). But you can derive week number from day number divided by 7…

So a formula might look like this:

ROUND(FORMAT_DATE(“oo”, NOW())/7)

For more details about this look at our Skuid.Time documentation