Free Trial

Alteryx Designer Desktop Discussions

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

Grouping and Assigning an ID

Deano478
12 - Quasar

Hi guys,

 

I've currently hit a road block with a task I'm trying to accomplish essentially what I am trying to do is assign an ID to each person every time they take leave. I have a feeling it has something to do with a multi row formula but all my attempts at configuring it so far have not gone well.

 

You can see in the proposed output that when the days are consecutive the ID stays the same i.e for Dean you can see 1 appears four times as they have 4 days off in a row. However for Jack you can see he only has one day off for 15/06/2023 so it assigns 3 and moves on to the next perosn.

 

I hope this makes sense as I'm having trouble even trying to word it 😂 any help is appreciated but I understand if this is also a big ask of anyone

 

Input:

 

IDNameDate Off
123Dean05/05/2023
123Dean06/05/2023
123Dean07/05/2023
123Dean08/05/2023
123Dean15/05/2023
123Dean16/05/2023
567Jack18/05/2023
567Jack19/05/2023
567Jack20/05/2023
567Jack21/05/2023
567Jack22/05/2023
567Jack23/05/2023
567Jack24/05/2023
567Jack15/06/2023
123Dean20/06/2023
123Dean21/06/2023
123Dean22/06/2023
123Dean23/06/2023
123Dean24/06/2023
123Dean25/06/2023
123Dean26/06/2023

 

The output I'm trying to accomplish is something like this:

 

IDNameDate OffGroup
123Dean05/05/20231
123Dean06/05/20231
123Dean07/05/20231
123Dean08/05/20231
123Dean15/05/20232
123Dean16/05/20232
567Jack18/05/20233
567Jack19/05/20233
567Jack20/05/20233
567Jack21/05/20233
567Jack22/05/20233
567Jack23/05/20233
567Jack24/05/20233
567Jack15/06/20234
123Dean20/06/20235
123Dean21/06/20235
123Dean22/06/20235
123Dean23/06/20235
123Dean24/06/20235
123Dean25/06/20235
123Dean26/06/20235
5 REPLIES 5
FinnCharlton
13 - Pulsar

Hi @Deano478 , here's the configuration you need:

FinnCharlton_0-1683887104064.png

 

Hope this helps!

ShankerV
17 - Castor

Hi @Deano478 

 

One way of doing this.

 

ShankerV_0-1683887391099.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @Deano478 

 

Step 1: Input 

ShankerV_0-1683887500349.png

 

 

Step 2: Change the date alteryx ISO format

ShankerV_1-1683887533864.png

ShankerV_2-1683887544810.png

 

 

Step 3:

ShankerV_3-1683887564206.png

datetimeadd([Row-1:Modified date],1,"day")

 

ShankerV_4-1683887587573.png

 

Step 4:

 

ShankerV_5-1683887640822.png

IF [Modified date]=[Temp date]
THEN [Row-1:Group]
ELSE [Row-1:Group]+1
ENDIF

 

ShankerV_6-1683887654011.png

 

Many thanks

Shanker V

 

 

 

Deano478
12 - Quasar

@FinnCharlton and @ShankerV You guys are absolute lifesavers this was stressing me out more then it needed to😂 I have sorted my issue now with you guy's help

binuacs
21 - Polaris

@Deano478 One tool approach

binuacs_0-1683993474893.png

 

Labels
Top Solution Authors