This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
The highly anticipated Alteryx Community tradition is back! We hope you'll join us!
Hi I am trying to change values in Column B based on criteria met in Column A.
For example, I want Column B to update each row B where the first 3 letters in Column A are read as "REC"
and I want Column B to update each row S where the first 3 letters are read as "Pay"
Go to Solution.
Go to Solution.
Assuming you just want to populate the data from A into B you could try a formula tool using Column B as the output column:
if Left([Column A], 3) = "Rec" then [Column A]elseif Left([Column A], 3) = "Pay" then [Column A]else Null()endif
I was about to post something but @AndrewS called it. As an alternative, you could use StartsWith([Column A], "Rec").
@TonyA - I forgot about StartsWith. I tend to stick to the old excel style formulas and I need to go beyond these.
@cambiukpytou To avoid a truncate warning, if FieldB is read in as only a string length of 1 you might need to add a select tool and set the length a bit higher to accommodate the new data.
Hi AndrewSNo i do not want to populate from A into B. I want data in B to be asdescribed based on conditions in Column A.For example,If Column A has the first 3 letters REC, then I want that same row item inColumn B to say "B".If ColumnA has the first 3 letters Pay, then i want the same row item incolumn B to say "S".
So then the formula was have a expression as
If StartsWith([Column A], "Rec"), then [Column B] = "B" ----?
Please imagine that Column B is actually blank. I left the B and S in there to show everyone what i want the output to look like.
Would this generate a B, for every Rec in column A?
You just need to change the original formula to:
if Left([Column A], 3) = "Rec" then "B"elseif Left([Column A], 3) = "Pay" then "S"else Null()endif
With the output column set to Column B. Got it thanks!!