Hello,
I have a data table like the example below:
user_id
value_1
1
new york
2
wrong value
3
cuba
4
paris
5
wrong value
6
wrong value
I know that the correct values to replace the wrong value rows in value_1 column are:
Amsterdam for user_id=2
Sidney for user_id=5
Singapore for user_id=6
So, my question is: how can I replace specific values based on specific column value condtion?
Which is the faster solution to the problem? Maybe a sort of if statement? Maybe should I use a dictionary made of the correct values to replace?
Attached is one way to do it, Yes I would use a table with the correct values. You cloud also write code in a Rule Engine or a Java Snippet but then if you would want to edit something you would have to go thru a lot of code.
Use your correct values as the second input to a Joiner, do left outer join joining on id, then you should have correct values in a new column with missing values where the original was correct.