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

Identify records with multiple categories within a group

keeprollin
7 - Meteor

Hello community,

 

In the given sample dataset, each part belongs to a certain part category, for example, Part A, Part B, Part C and Part D belong to 'abc' category while Part P, Part Q, and Part R belong to 'xyz' category.

 

Case NoPart NoPart Category
1Part Aabc
1Part Pxyz
2Part Cabc
3Part Cabc
3Part Qxyz
4Part Dabc
4Part Dabc
5Part Rxyz
5Part Rxyz
6Part Babc
6Part Aabc
6Part Pxyz

 

 

I'm looking to find the cases that use a combination of categories abc and xyz for each Case No. I'm not interested in getting those cases which have only one Category attributed to it. For example, Case No 1 has both categories abc and xyz, and Case No 2 has only only category abc attributed to it, so I would not include it in my output. Similarly, Case No 3 and 6 have both categories attributed to it while Case No 4 and 5 do not. So, I would include only Case No 3 and 6. 

 

My final Table would look something like the one below:

 

Case NoPart NoPart Category
1Part Aabc
1Part Pxyz
3Part Cabc
3Part Qxyz
6Part Babc
6Part Aabc
6Part Pxyz
3 REPLIES 3
Luke_C
17 - Castor

Hi @keeprollin 

 

Are you specifically looking for the two categories? Or looking for any cases that simply use more than 1 category? 

DataNath
17 - Castor

How's this?

 

DataNath_0-1652280422323.png

 

IraWatt
17 - Castor
17 - Castor

Hey @keeprollin,

This approach groups by Case No and counts the distinct part categories. The Filter then only passes Case No's with more then two part categories. The center join then filters off records which don't match.   

IraWatt_0-1652280680939.png

To change to matching to just two distinct values you can just change the filter to only allow distinct_catagories = 2

HTH,

Ira

 

Labels