Start Free Trial

Alteryx Designer Desktop Discussions

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

How to Calculate value of one column based on values in another column

Jairacha
7 - Meteor

Hi - I'm trying to derive the value of Col.C (below) based on the values in Col.B (below) for each record in Col.A (below). I would like to accomplish this using the formula tool. 

 

Example:

In the table below, I would like to flip all the values in Col.C to "Yes" only IF Col.B has both "Yes" and "No" for each record in Col.A (X, Y, Z). So if and only if I have a "Yes" and "No" for the record "X" in Col.A, then the values in Col.C would be "Yes" for the record "X". If all the values in for a record in Col.A ("Y") are "Yes" then the values in Col.C should be "Yes". If all the values in for a record in Col.A ("Z") are "No" then the values in Col.C should be "No". 

 

Col.AColB.Col. C (calculated)
XYesYes
XYesYes
XNoYes
XYesYes
YYesYes
YYesYes
YYesYes
ZNoNo
ZNoNo
ZNoNo
ZNoNo
ZNoNo

 

Appreciate the help with this!!

1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @Jairacha there's a few variations of doing this but here's one. We just use a Summarize tool with the 'Longest' string method, grouped by [Col.A], and then join this back to the starting dataset:

 

Calculated yes-no column.png

Labels
Top Solution Authors