Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Searching common items in two different cells

yad
5 - Atom

Hi All,

 

I'm stuck in a business requirement where I need to find common values in two different rows and then output the values in a new column.

The values are comma-delimited and do not adhere to a specific order.

 

 

Sample Input: 

 

ProfileEntitlements
A1, 2, 3
A4, 2, 1, 5
A1, 6 ,4
B1, 2, 3, 5
B6, 7, 8, 9

 

Expected Output:

 

ProfileEntitlementsCommonality
A1, 2, 31,2
A4, 2, 1, 51,2
A1, 6 ,4, 21,2
B1, 2, 3, 5n/a
B6, 7, 8, 9n/a

 

Thanks!

5 REPLIES 5
LJoonas
7 - Meteor

Hi,

 

Here could be one possible solution.

 

I first split all the Entitlements to separate columns and transposed them. Then I took count of all the values and compared it to count of Profile rows. If count and Profile match then the Entitlements value should be in all rows for the profile. Then I Cross Tab the result and combine it to the original rows with Find and Replace tool. This might need some modification and to make sure that text to columns tool splits to enough columns. Let me know if this works.

 

Edit. fixed the naming on the workflow

sahmed
5 - Atom

Hi, 

 

Please find attached alteryx workflow with one more solution for your requirement.

 

Thanks,

yad
5 - Atom

hey, thanks a lot for the solution! 

Unfortunately, I've misread the requirement and it looks like the analysis will be done among profiles under the same set which complicates things.

 

Sample Input: 

 

SetProfileEntitlements
1A1, 2, 3
1B4, 2, 1, 5
1C1, 6 ,4
2A1, 2, 3, 5
2B6, 7, 8, 9

 

Expected Output:

 

SetProfileEntitlementsCommonality
1A1, 2, 31,2
1A4, 2, 1, 51,2
1A1, 6 ,4, 21,2
2B1, 2, 3, 5n/a
2B6, 7, 8, 9n/a


If you have any idea for this, I'd appreciate some pointers.

 

Regardless, you have answered the question at hand. So marking this as the solution. Thanks!

sahmed
5 - Atom

I have modified the Alteryx Workflow. Check this one.

LJoonas
7 - Meteor

Could you elaborate this a bit? Is the analysis done based solely on the "Set" -column and ignoring the "Profile" -column? If so you can just change the parts where "Profile" column is used to "Set" column and then just join the commonalities in the end as was before. In your example, the Input and Output don't match so I'm not quite sure want is the needed outcome if it is not like the workflows suggested. Hopefully you can open this up a bit more so we might find a solution.

Labels