Calling all Alteryx customers: Refer your colleague to try Alteryx and receive a $50 gift card. Sign up now!
Free Trial

Alteryx Designer Desktop Discussions

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

Adding consecutive rows based on consecutive dates

DanielCarro
8 - Asteroid

Hi guys,

 

I have the following:

Note: in DATE2 DAY WEEKDATE, taking away the weekends.

 

I couldn't use summarize tool to group the id as I have different dates and wouldn't add the correct criteria. I tried using multi-row formula but not giving me the result I needed.

 

Multi-row formula used:

IF [DATE2 DAY WEEK DATE]=[Row+1:Date] THEN [Days]+1 ELSE [Days] ENDIF

 

INPUT     OUTPUT    
IDTYPEDATEDATE2 DAY WEEKDATEDAYS IDTYPEDATEDATE2 DAY WEEKDATEDAYS
3865Holidays 02/07/202403/07/20240.5 3865Holidays 02/07/202403/07/20246.5
3865Holidays 03/07/202404/07/20241 3865Holidays 30/07/202431/07/20241
3865Holidays 04/07/202405/07/20241 3929Holidays 04/07/202405/07/20242
3865Holidays 05/07/202408/07/20241 3929Holidays 19/07/202422/07/20241
3865Holidays 08/07/202409/07/20241 3929Holidays 23/07/202424/07/20242
3865Holidays 09/07/202410/07/20241 3929Holidays 30/07/202431/07/20241
3865Holidays 10/07/202411/07/20241      
3865Holidays 30/07/202431/07/20241      
3929Holidays 04/07/202405/07/20241      
3929Holidays 05/07/202408/07/20241      
3929Holidays 12/07/202415/07/20241      
3929Holidays 19/07/202422/07/20241      
3929Holidays 23/07/202424/07/20241      
3929Holidays 24/07/202425/07/20241      
3929Holidays 30/07/202431/07/20241      
1 REPLY 1
CoG
14 - Magnetar

Generating the desired output is best accomplished in a twofold process. First use the Multi-Row Formula Tool to generate a group ID field that you can feed into the Summarize Tool to ensure that aggregation occurs as expected:

Screenshot.png

Hope this helps and Happy Solving!

Labels
Top Solution Authors