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

Check if values in one column exist in another and update a third.

DMDingo
5 - Atom

I am new to Alteryx and cannot find a solution for this. We have three columns of data:

Column A is the ID
Column B is Parent's ID (like hierarchy)

Column C is the Type

 

For each row, we need to lookup if Column A exist anywhere in Column B, and overwrite Column C with a new value if this is True. If not, no change.

 

Here is an example:

RowABC
1215 Associate
2122215Associate
3554 Manager

 

For this example, because "215" is showing in B, we would want the Value C in Row 1 to update to "Manager". All other values in C would need to stay the same.

 

 

 

 

Thank you!

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @DMDingo

 

Could you give us an example of how your data looks like?

 

It's possible, but I wanna know one thing:

 

For ex., if Parent ID is "112", and ID is "12", you have "12" present on Column B....then you want to overwrite column C with which value?

Is that the situation? 


Cheers,

 

jdunkerley79
ACE Emeritus
ACE Emeritus

Based on what you described:

 

2018-12-03_18-58-47.png 

 

1. Self join the data to itself (A to B)

2. L output is stuff not preset, J output is stuff present

3. Use a formula tool to manipulate column C

4. Use a union tool to put it back together

 

Sample attached but if you can post some fake data easier to get closer

DMDingo
5 - Atom

I have added a little example table in the question.

DMDingo
5 - Atom

Thanks for the info. I have added an example table in the question. Would this still work?

jdunkerley79
ACE Emeritus
ACE Emeritus

Yep works fine - have updated the sample

DMDingo
5 - Atom

EDIT - For some reason it was duplicating the rows. Added Unique before the Formula and fixed it.

 

Thanks, this was close but did cause some issues with the output.Can you run this for this data set? In this case we would see 123 in B and update the top to to "Parent".

 

ABC
123 Unknown
123 Unknown
154123Child
554 Parent
554 Parent

 

What we have are multiple rows that share the same group, and the group needs to be updated across them. When I ran this on the data set, I went from 89,000 rows to 1.7 million. 

So, updated your workflow and it still works. What would be causing our number to sky rocket?

jdunkerley79
ACE Emeritus
ACE Emeritus

Ah I had assumed unique column A and B.

 

2018-12-03_20-43-54.png

 

A minor adjustment - summarise B to unique values should fix

Labels