community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Convert Date to Week

Highlighted
Alteryx Partner

I had a requirement to group data as per week. After referring many sources, I have come up with this simple macro which calculates Year, Month, Week and Start of week date from the Date field. The 'Start of Week' field can be used to group data by week. 

The week starts with Sunday.

Alteryx
Alteryx

Hi,

 

Nice job :)

You can also use the date agregator macro to do it :

https://community.alteryx.com/t5/Engine-Works-Blog/The-Date-Aggregator-Macro/ba-p/2365

 

Regards,

 

Irene

Alteryx Certified Partner

You can get start of week this way too,

 

datetimeadd(Date, -tonumber(datetimeformat([Date], '%u')), 'day')

 

 

Alteryx Partner

@itestu Thank you. Will check the macro :)

Labels