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

Alteryx Designer Desktop Discussions

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

Check a specific field in dataset depending on the value of a string

phil_budden
8 - Asteroid

Hi All,

 

I have a dataset which looks something like below (only with hundreds of fields):

 

PART_ID LOCATION_TO_CHECK_1 LOCATION_TO_CHECK_2 LOCATION_TO_CHECK_3 LOCATION_A LOCATION_B LOCATION_C LOCATION_D
PART_1 LOCATION_A LOCATION_B LOCATION_C 1 5 1 0
PART_2 LOCATION_B LOCATION_C LOCATION_D 3 1 0 1
PART_3 LOCATIN_C LOCATION_D NA 2 0 0 3

 

I want to replace the text in "LOCATION_TO_CHECK_X" with "Y" or "N" depending on if the number in the denoted location is >0

 

I assume I'm going to use an IF statement but how do I tell Alteryx to check the right field?  I can't manually tell it which location to check as my workflow to this point has populated these fields based on certain criteria so this will change when I run differnet data through it.

 

Any ideas welcome, thanks in advance.

3 REPLIES 3
jdunkerley79
ACE Emeritus
ACE Emeritus

Think the simplest way is to use a couple of transposes

- On the Location to Check fiels

- On the Location fields

 

Then join the two outputs of these together and use a simple formula to convert to Y/N 

 

Finally Cross tab back to original layout.

2016-04-04_12-40-55.jpg

 

If you have a really dynamic number of fields this approach probably wont work as would need to be changed for each set of columns.

phil_budden
8 - Asteroid

Thanks, I'll give this a go and see if it works Smiley Happy

phil_budden
8 - Asteroid

It worked Smiley Very Happy

 

Thanks for your help

Labels
Top Solution Authors