Replace based on logic

Apologies if this was already answered: how do I replace the value of Column A based on logic from Column B?

Example: Column A = Weather and Media and Column B = Media. I want, for the cases where column B = Media to replace Column A value by Column B name.

Use an If transform to create a new column then use this to replace the existing column.

The If can look something like this:

if $(B) = Media

Sorry I cannot reply to the other thread as it says, new user can only reply 3 times in a thread.

So answer to your question

If you want to use the column name in expressions like $(columnname) then column name should not have any spaces or any other special characters.

Thank you. That is a very important point that wasn’t clear to me. Maybe the documentation should be updated to make that super transparent. I was breaking my head trying to understand why, but the answer was actually pretty simple :slight_smile:

I will certainly look into it. i can’t see any reason in principal why column names couldn’t contain parentheses.