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 for pairs in data

Alex_Br
5 - Atom

Hello,

 

I am rather new to Alteryx so it might be, that my question has an easy solution, which I don't understand yet, but I have been looking through different threads here for a while and can't seem to find a solution to the problem I am facing in Alteryx. I have two Data Inputs and want to get all combinations defined in Input 2 which each user has in Input 1. Please see below the two inputs and the desired result.

 

Input 1

UserFunction
User 1 Function X
User 2Function X
User 2Function Y
User 2Function Z
User 3Function Y
User 3Function Z
User 4Function X
User 5Function X
User 5Function Y

 

Input 2 

 

RiskFunction 1Function 2
Risk 1Function XFunction Y
Risk 2Function YFunction Z

 

Result:

UserRisk 
User 2Risk 1
User 2Risk 2
User 3Risk 2
User 5Risk 1

 

So I want a list returning all Risks (which consist of 2 functions) which each user has. I have overall about 250 different risks I am looking for.

 

Thanks in advance for your help.

 

Alex

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @Alex_Br 

 

I personally wouldn't say this is a simple straightforward usecase. I had to think couple of way to solve it problem 😅.

 

Here is how you can do it.

Workflow:

atcodedog05_0-1628494561805.png

 

1. Using transpose tool to convert functions columns to rows.

2. Using join tool to join on function value.

3. Using crosstab to convert back to table with columns function_1 and function_2

4. Using filter tool to only keep rows where function_1 and function_2 are both not empty.

 

Hope this helps : )

Alex_Br
5 - Atom

Thanks a lot for the quick reply. It seems to work great.

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Alex_Br 

Cheers and have a nice day!

Labels