Alteryx Designer

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

Date Coversion

Highlighted
5 - Atom

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?

 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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

Highlighted
11 - Bolide

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