We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Sorting data based on the day of the week

Deano478
12 - Quasar

Hi Alteryx Crew,

 

I'm pretty new to Aletryx and have what might be a simple problem to solve but I'm trying to order this data based on the Day_of_Week from "Monday" to "Sunday". to get the day of the week for each date I used the formula DateTimeformat([Submission_Date], "%A").  As mentioned it might be simple problem to solve but I'm just drawing a blank.

 

All help is much appreciated guys and gals. 

 

Activity_IDSubmission_DateResponders_EmailRepeat_For_The_WeekDay_of_Week
22110/09/2021 08:17una.Murphy@test.comRepeat my activity index for the remainder of the weekFriday
32013/09/2021 16:30yiu.Rao@test.comRepeat my activity index for the remainder of the weekMonday
31411/09/2021 16:34Mark.Alonso@test.comRepeat my activity index for the remainder of the weekSaturday
186103/10/2021 22:06Kevin.Martins@test.comRepeat my activity index for the remainder of the weekSunday
11209/09/2021 16:30Maria.Union@test.comRepeat my activity index for the remainder of the weekThursday
44114/09/2021 16:30Tony.Barker@test.comRepeat my activity index for the remainder of the weekTuesday
1108/09/2021 16:37Joe.Bloggs@test.comRepeat my activity index for the remainder of the weekWednesday
4 REPLIES 4
gautiergodard
13 - Pulsar

@Deano478one way to do this would be to create a formula to assign a number to each day of the week and then sort based on that newly created field.

 

example:

 

if dayofweek = Monday then 1

elseif dayofweek = Tuesday then 2

elseif dayofweek = Wednesday then 3

 

etc…

 

hope this helps !! 

 

Felipe_Ribeir0
16 - Nebula

Hi @Deano478 

 

You can use the DateTimeFormat([Submission_Date], '%u') formula to transform the date into a week day number between 1 and 7 and order by it.

 

%uDay of week as a decimal, 1 to 7, with Monday as 1

 

Felipe_Ribeir0_0-1666872386298.png

 

Sarreddy
9 - Comet

@Deano478 

 

 

Sarreddy_0-1666876239979.png

 

Deano478
12 - Quasar

@Sarreddy, @Felipe_Ribeir0@gautiergodard. Thank you all so much for you various approaches I tired all of them and they all work very well in different ways this has given me a strong idea in my head now going forward. Its the simplest things that make a big difference going forward 

Labels
Top Solution Authors