Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter data based on multiple rows

richard_gardner
7 - Meteor

I'm struggling to figure this one out. I need to be able to figure out the open and close for each case, but include scenarios when a case is re-opened, so it's not as simple as the first open and the last close. I've tried the tile tool but can't seem to get it set right.

 

My input looks like this:

Case NumberStatusRepSupervisorStatus DateClosure Reason
1111OpenMikeEric3/17/2021 15:57 
1111ClosedMikeEric3/22/2021 11:20Resolved
1112OpenBob BPhil5/29/2021 17:12 
1112OpenBob BPhil5/29/2021 18:00 
1112OpenBob BPhil5/29/2021 18:01 
1112OpenBob BPhil5/30/2021 9:47 
1112ClosedBob BPhil5/30/2021 9:50Withdrawn
1112OpenBob BPhil11/26/2021 18:20 
1112OpenBob BPhil11/27/2021 7:14 
1112ClosedBob BPhil11/27/2021 7:44Resolved
1112OpenBob SEric12/17/2021 10:13 
1112OpenBob SEric12/17/2021 10:24 
1112ClosedBob SEric12/17/2021 11:06Resolved
1113OpenJoePhil5/9/2021 9:30 
1113ClosedJoePhil5/10/2021 10:10Withdrawn
1113OpenSueDave6/7/2021 13:03 
1113ClosedSueDave6/13/2021 8:38Resolved

 

 

 

And my output should look like this:

Case NumberOpen DateClose DateRepSupervisorClosure Reason
11113/17/2021 15:573/22/2021 11:20MikeEricResolved
11125/29/2021 17:125/30/2021 9:50Bob BPhilWithdrawn
111211/26/2021 18:2011/27/2021 7:44Bob BPhilResolved
111212/17/2021 10:1312/17/2021 11:06Bob SEricResolved
11135/9/2021 9:305/10/2021 10:10JoePhilWithdrawn
11136/7/2021 13:036/13/2021 8:38SueDaveResolved

 

How can I do this?

3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @richard_gardner 

 

Here's how I would approach this:

 

  1. Parse the date into date time format & sort the data by case/date (just in case data is not already sorted)
  2. Multi-row formula to determine if a case has been reopened - this checks a given case number's record to see if the previous record was 'closed'.
  3. Separate the closed records and join them back to the open records to get the open/close time in the same row
  4. Sort data again
  5. Take the first instance of each Case/Close time to remove records with repeated open statuses

 

Luke_C_1-1641406449252.png

 

ArtApa
Alteryx
Alteryx

Hi @richard_gardner - Almost everything in Alteryx can be done in a couple of different ways:

 

ArtApa_0-1641428747023.png

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @richard_gardner 

 

Here is my take on it

 

Workflow:

atcodedog05_1-1641459771159.png

 

Hope this helps : )

Labels
Top Solution Authors