Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Grouping rows by consecutive dates with other criteria

celinearamouni
6 - Meteoroid

Hi everyone,

 

I've looked around the community for an Alteryx solution but can't seem to find one - so posting it! 

 

Basically what I have is a row for each night at an hotel by the employee. For the same report # submitted by that employee, he stayed in multiple cities and multiple times. I've color coded each stay together based off the consecutiveness of the dates. So what I'm looking to do and group all of the nights for each stay together with my output having the check in (the earliest date) and the checkout (the latest date). 

 

Input:

EmployeeReport KeyTransaction DateCityCountryFYQJob Charge TypeDepartment
AN1162025/01/2020DubaiUAEFY20Qtr3BillableTT
AN1162026/01/2020DubaiUAEFY20Qtr3BillableTT
AN1162027/01/2020DubaiUAEFY20Qtr3BillableTT
AN1162028/01/2020DubaiUAEFY20Qtr3BillableTT
AN1162029/01/2020DubaiUAEFY20Qtr3BillableTT
AN1162002/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162003/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162004/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162005/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162009/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162010/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162011/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162016/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162017/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162018/02/2020JeddahKSAFY20Qtr3BillableTT
AN1162019/02/2020JeddahKSAFY20Qtr3BillableTT

 

 

Output:

FYQJob Charge TypeDepartmentCityCountryReport Legacy KeyCheck inCheck out
FY20Qtr3BillableTTDubaiUAE1162025/01/202029/01/2020
FY20Qtr3BillableTTJeddahKSA1162002/02/202005/02/2020
FY20Qtr3BillableTTJeddahKSA1162009/02/202011/02/2020
FY20Qtr3BillableTTJeddahKSA1162016/02/202019/02/2020

 

 

Ideal Output:

FYQJob Charge TypeDepartmentCityCountryReport Legacy KeyCheck inCheck out
FY20Qtr3BillableTTDubaiUAE11620-125/01/202029/01/2020
FY20Qtr3BillableTTJeddahKSA11620-202/02/202005/02/2020
FY20Qtr3BillableTTJeddahKSA11620-309/02/202011/02/2020
FY20Qtr3BillableTTJeddahKSA11620-416/02/202019/02/2020

 

 

I tried to do it with the summarize tool but couldn't haha...

Would appreciate your help

12 REPLIES 12
DenisZ
11 - Bolide

I have provided the full workflow below

 

DenisZ_0-1668589120441.png

 

celinearamouni
6 - Meteoroid

Hi Denis,

 

Unfortunately it didn't work when I used it on a larger number of rows. To make things easier, I've attached my whole dataset. You can check for report # 11620 as a sample that contains the hardest criteria. So if that report is good, all of it should be good

 

Thanks

ShankerV
17 - Castor

Hi @celinearamouni 

 

Please find the below solution which will work for even very huge dataset.

 

ShankerV_0-1668594038660.png

 

 

Many thanks

Shanker V

celinearamouni
6 - Meteoroid

Could  please attach the workflow please? Thanks!

DenisZ
11 - Bolide

Could you explain what did not work. If there is a grouping that is not wanted, do remove it. If you could attach an ideal output for 11620 then I can look closer at it. 

ShankerV
17 - Castor

Hi @celinearamouni 

 

Please find the output for the test2 file attached with raw data.

 

I did few changes to reach the output as we need to sort the dates.

 

ShankerV_0-1668594844621.png

 

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

@celinearamouni 

 

This is your input shared in the Raw file

 

ShankerV_0-1668594956801.png

 

The heading are modified as per your input.

I modified the Department from T to TT like you shared initially.

 

Output: 

 

ShankerV_1-1668595042942.png

 

Many thanks

Shanker V

 

Workflow:

Step 1: Input

Step 2: 

ShankerV_2-1668595089601.png

 

Step 3: 

 

ShankerV_5-1668595139624.png

 

 

 

Step 4: 

ShankerV_4-1668595127476.png

 

Step 5: 

 

ShankerV_6-1668595158564.png

 

 

 

 

 

ShankerV
17 - Castor

@celinearamouni 

 

Step 6:

 

ShankerV_0-1668595198222.png

 

Step 7:

ShankerV_1-1668595215115.png

 

Step 8: 

ShankerV_2-1668595239764.png

 

Step 9:

ShankerV_3-1668595254364.png

 

 

Step 10;

ShankerV_4-1668595268851.png

 

Here you get the result:

 

ShankerV_5-1668595285272.png

 

Kindly accept this solution if it provided a solution to your question.

 

Many thanks

Shanker V

 

celinearamouni
6 - Meteoroid

I didn't get the same result as you even though I have followed the same steps. Any idea why?

See below screenshot for report 11620 and workflow.

celinearamouni_0-1668599708570.pngcelinearamouni_1-1668599717815.png

 

Labels