Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Date Coversion

magsbiel
7 - Meteor

Hi,

 

I need to assign a date to the weeks starting with Sunday. Let's say 6/26/2020 should be 6/21/2020. For date July st, it should be 06/28/2020. I care here about starting week Sunday than the actual date. Any idea how to accomplish it?

 

2 REPLIES 2
AbhilashR
15 - Aurora
15 - Aurora

Hi @magsbiel, I put together a quick sample solution to help adjust a given date to its corresponding start of the week (Sunday). 

AbhilashR_0-1593232595898.png

I hope this help.s

kelly_gilbert
13 - Pulsar

Similar to @AbhilashR's solution, you can also use the date specifier %w to get the weekday number, where Sunday is 0 and Saturday is 6:

 

datetimeadd(
  [original_date],
  -tonumber(datetimeformat([original_date], '%w')),
  'day'
)

 

Labels