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:
Profile | Entitlements |
A | 1, 2, 3 |
A | 4, 2, 1, 5 |
A | 1, 6 ,4 |
B | 1, 2, 3, 5 |
B | 6, 7, 8, 9 |
Expected Output:
Profile | Entitlements | Commonality |
A | 1, 2, 3 | 1,2 |
A | 4, 2, 1, 5 | 1,2 |
A | 1, 6 ,4, 2 | 1,2 |
B | 1, 2, 3, 5 | n/a |
B | 6, 7, 8, 9 | n/a |
Thanks!
Solved! Go to Solution.
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
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:
Set | Profile | Entitlements |
1 | A | 1, 2, 3 |
1 | B | 4, 2, 1, 5 |
1 | C | 1, 6 ,4 |
2 | A | 1, 2, 3, 5 |
2 | B | 6, 7, 8, 9 |
Expected Output:
Set | Profile | Entitlements | Commonality |
1 | A | 1, 2, 3 | 1,2 |
1 | A | 4, 2, 1, 5 | 1,2 |
1 | A | 1, 6 ,4, 2 | 1,2 |
2 | B | 1, 2, 3, 5 | n/a |
2 | B | 6, 7, 8, 9 | n/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!
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.