Alteryx Designer Desktop Discussions

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

Overlay a column based on text in any of several columns

Rob48
8 - Asteroid

Hi, I need to overlay the existing data in a column with new data based on whether the text in any cell of several other columns matches a list from a separate data set.  I've tried several approaches but I can't quite get it to work without getting too unwieldy and i'm sure there's a more elegant solution.

 

As an example, here's a list of people who's profession is known to be jugglers:

 

List of Jugglers
Smith
Jones
Brown
Moore
Johnson
Miller
Taylor

 

My main data looks like the below.  If any of the people in the list of jugglers show up in the "Names" columns 1-5 then i need to overlay the data in the "Profession" column with "Juggler"

 

Name 1Name 2Name 3Name 4Name 5ProfessionUser ListProfessing w/Overlay
otherotherotherMooreotherDoctor

User 1

Juggler
otherotherotherotherotherLawyer

User 2

Lawyer
otherotherSmithotherotherDoctorUser 3Juggler
otherotherotherotherotherFiremanUser 4Fireman
JohnsonotherotherotherotherAccountantUser 5Juggler
otherotherotherotherotherFiremanUser 6Fireman
otherotherotherotherMillerPolicemanUser 7Juggler
otherotherotherotherotherLawyerUser 8Lawyer
otherotherotherotherotherMusicianUser 9Musician
otherotherotherotherotherFiremanUser 10Fireman
TaylorotherotherotherotherPainterUser 11Juggler
otherotherotherotherotherPainterUser 12Painter
otherotherotherotherotherAccountantUser 13Accountant

 

 

 

4 REPLIES 4
binuacs
21 - Polaris

@Rob48 One way of doing this

image.png

OllieClarke
15 - Aurora
15 - Aurora

Hey @Rob48 

Here's one way of doing this:image.png

I've used Find and Replace tools as they're more performant than Join tools when matching on a single string field.

There are other ways which don't involve transposing the full data, but they are more complicated to configure. Let us know if that's a consideration.

Ollie

jdminton
12 - Quasar

Here's a way that takes a few tools, but is pretty simple and dynamic.

Snag_19abaa11.png

Snag_19abd392.png

  

ScottLewis
10 - Fireball

Simplest version I could come up with. As should be clear from the other examples, there are a lot of ways to do this, depending on what tools you're comfortable with, how robust you need to be and whether you need to keep the original profession as well as the overlay. 

 

Generally, you can split tasks like this into two steps. First, flagging the rows with some characteristic. Second, taking some action on that subset and either no action or a different action on the remainder of the original set. The second task often takes the form of join (original set to subset) followed by formulas on the left/join outputs and a union to put the original set back together.

 

Overlay.PNG

Labels