@ dgudkov
I just need help for simple ETL changes I have two columns name city and country, and I want to replace with where condition like
if column country value ‘200’, I want to replace column city value ‘New york’ to ‘Atlanta’
I know its can be done through modify column expression but I need some help.
City |
Country |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
New york |
200 |
What I see here is a 2-column lookup where 2 columns should match in order for the replacement to happen. Usually, you would want lookups to be defined declaratively in a lookup table, instead of using expressions. When lookups are defined using a table, they are easier to manage and understand. Modifying specific values in expressions can be error-prone.
Typically, multi-column lookups are done by creating a key field that concatenates all fields required for matching. Then the lookup is done by the key field. See the example below.
2column-lookup.morph (4.9 KB)