Alteryx Designer Desktop Discussions

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

Create Date Range from raw dates

kianhozz
5 - Atom

Hi Community,

 

I am looking to create a new column that will have a date range from a list of raw dates. I want the date range to start on a Monday and end on a Sunday.

 

For example, if the date in a column is showing 2023-01-16, I would like a new column next to this that shows the range 2023-01-16 - 2023-01-22.

 

Would appreciate any help.

5 REPLIES 5
SPetrie
13 - Pulsar

I dont think I fully grasp the ask.

If a column has 6 rows of dates, are you wanting to create 6 new columns with those ranges?

Can you give an example input and expected output?

 

 

 

Prometheus
12 - Quasar

@kianhozz I used this function to get the end date of your 7-day range: DateTimeAdd([Start Date],7,'days'). Then I concatenated the start date and end date of your range: tostring([Start Date])+'-'+tostring([End Date]). 

Date Range.PNG

**Caveat: This is under the assumption that your start date will be a Monday. If not, then there are other things you'll need to add to make it work.

kianhozz
5 - Atom

I.e, on rows 5 & 6, I would like a new column that simply lists 2023-01-09 - 2023-01-15 (As the 11th is a Wednesday).

 

Annotation 2023-10-19 124923.png

Prometheus
12 - Quasar

@kianhozz As @SPetrie stated earlier, if you would upload some dummy data and give us an example of your expected output, it would be much easier to provide a solution. Thanks.

SPetrie
13 - Pulsar

This is a guess based on what you have shown. I wasnt sure if all dates would be uniform or mixed, but this would work in either situation.

ranges.PNG

Labels
Top Solution Authors