Community Halloween is live until October 31st! Complete any 2 quick activities to earn the 2025 Community Halloween badge. Feeling brave? Check out the activities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter based on count of rows and pattern

shivraj_r
7 - Meteor

Hi All,

 

Below is a sample of my data set - 

What I'm trying to do is filter only those entries for within the B count where number of (attach) = Number (detach) and occurring consecutively - so for every attach there has to be a detach as the next event.I also want to keep the grouping by B count in the output. I'm struggling a little bit in terms of what function to use - I was thinking if there is function that would count the number of rows that would contain attach and detach and I could use a Mod function to output based on even number of events? I was also trying some form of logic with the mutli row formula but no luck so far! Thanks in advance!

 

 

Input 

IDEvent

B Count

1Attach1
1Detach1
1Attach1
1Detach1
2Attach4
2Attach5
2Attach5
2Detach5
2Detach5
3Attach100
3Detach100
3Attach101
3Detach101

 

 Expected output

IDEvent

B Count

1Attach1
1Detach1
1Attach1
1Detach1
3Attach100
3Detach100
3Attach101
3Detach101
1 REPLY 1
ponraj
13 - Pulsar

Here is the solution for your case. Hope it helps. 

 

WorkflowWorkflowResultsResults

 

Labels
Top Solution Authors