coalesce on multiple fields in transform map

caffry
Kilo Guru

i need to have coalesce on two fields where one field is the number field and the other is name field.

it should check for both name and the number field then it should update the record, but for me even if the name field is not present the field gets updated..

1 ACCEPTED SOLUTION

Thats correct, It would insert the record because now it checks the unique combination of name and number. It does not check just the name alone.

For eg you have an entry with Name as Don and number as 123 and a new entry is imported with name as Don and number as 124, the latter entry is new combination of name & number (Since both are added as the coalesce). So it would definitely insert which is working as expected. Again, If you need to update then you should be sending the same combination of Don and 123

View solution in original post

8 REPLIES 8

Alikutty A
Tera Sage

Hi,

Please add these lines in your Run scripts portion of transform map. 

This will check if name is empty or number is empty, then ignore the row. Please rename the fields with actual name from your source table

if(source.u_name == "" || source.u_number == '"){

ignore = true;

}

Thanks

what if the name is already present and the number is unique since i have mentioned as coalesce it should skip or ignore right but it inserts a new record it checks only for number not for name...

Thats correct, It would insert the record because now it checks the unique combination of name and number. It does not check just the name alone.

For eg you have an entry with Name as Don and number as 123 and a new entry is imported with name as Don and number as 124, the latter entry is new combination of name & number (Since both are added as the coalesce). So it would definitely insert which is working as expected. Again, If you need to update then you should be sending the same combination of Don and 123

yes both are added as coalesce right so y again DON pops up for 124 id ..it should not right since coalesce looks for unique one.