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

Date sequence based on duplicated ID

DanielCarro
8 - Asteroid

Hi Guys,

 

Need some assistance on this one.

 

I have the following data:

IDMonth RecordDate
212025-02-03
222025-02-04
232025-02-05
3102025-02-14
412025-02-03
5132025-02-19
5142025-02-20
5152025-02-21
662025-02-10
672025-02-11
692025-02-13
610

2025-02-14

 

 

 

Expected Output

 

IDFIRST DATELAST DATE
22025-02-032025-02-05
32025-02-142025-02-14
42025-02-032025-02-03
52025-02-192025-02-21
62025-02-102025-02-11
62025-02-13

2025-02-14

 

Much appreciated any assistance

 

Kind Regards,

Dan

4 REPLIES 4
Luke_C
17 - Castor
17 - Castor

Hi @DanielCarro 

 

The summarize tool should be able to do this for you. Depending on your definition of first/last, you will want to use the min max or first last options in the tool. The former is based on the dates themselves regardless of order, the latter is based on the order they appear in the data. 

 

image.png

DanielCarro
8 - Asteroid

Hi @Luke_C ,

 

There is a logic. For example, ID 6, it has a sequence 6 -7 which needs the first date 10/02/2025 to 11/02/2025 and for ID 6 which needs first date 13/02/2025 - 14/02/2025. The month record is the consecutive day sequence.

In some cases, you just have one day which will be the same day, for example with ID3

Luke_C
17 - Castor
17 - Castor

Hi @DanielCarro 

 

Thanks for clarifying the logic. I've made some inferences but a multi-row tool to check for consecutive months should get this to work:

 

The formula checks to see if the month is sequential for each ID otherwise it assigns a new sequence. 

image.png

DanielCarro
8 - Asteroid

Hi @Luke_C ,

 

It worked perfectly. Thank you 

Labels
Top Solution Authors