Help

Re: Calculate "Week Commencing" - Not quite right...

Solved
Jump to Solution
2013 0
cancel
Showing results for 
Search instead for 
Did you mean: 
newland101
4 - Data Explorer
4 - Data Explorer

Hi guys,

We have a field that lists the publish date + time for a piece of web content. 

We want to be able to organise all of these dates into 'week commencing', ie. add a field that gives the date of the Monday of that week. So, an item published say on Thurs 22nd December 2022, falls into 'Week Commencing' 19th December 2022. Something published on Friday 23rd December 2022, also the same Week Commencing date. 

The formula we're using to do this is:

DATEADD({CONTENT PUBLISH DATE},1-WEEKDAY({CONTENT PUBLISH DATE}),'days')

And it sort of works. But it seems to want to force some content pieces from the end of the week into the next week and I'm unsure why. For example, I have a piece of content dated for the 11th December 2022, 3pm, yet it forces it into week commencing 12/12/2022. 

Any ideas why this might be?

1 Solution

Accepted Solutions
John_B2
6 - Interface Innovator
6 - Interface Innovator

First make sure all timezones are the same.

Second - try this

DATEADD({CONTENT PUBLISH DATE},0-WEEKDAY({CONTENT PUBLISH DATE},"Monday"),'d')
 

See Solution in Thread

2 Replies 2
John_B2
6 - Interface Innovator
6 - Interface Innovator

First make sure all timezones are the same.

Second - try this

DATEADD({CONTENT PUBLISH DATE},0-WEEKDAY({CONTENT PUBLISH DATE},"Monday"),'d')
 

You sir, are a star, thank you! Happy New Year!