Expand my Community achievements bar.

SOLVED

Replace empty string with default value on data preparation

Avatar

Community Advisor

Team,

We are trying to ingest the email value (string as data type) from source to AEP data lake and there are some empty value. Since the email data type is secondary identifier (I think so) platform doesn't allow us to ingest the empty value and so we are ending with format related error. We could suspect that only due to the empty value being ingesting on the platform we are facing the formatted error. We have tried with solving this issue using calculated filed and no luck yet.

I know it is only possible from calculated field. Could you please let me know which fucntion we should be utilising to over come this issue and let me know if any.

123.JPG

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

HI @AtulChavan , Thanks for the reply. Firstly, since it is OOTB field it is required to be on the datasets and so it is mandatory to have the data on the list. Also, we have been getting the empty string and not the NULL value. We have also tried with having the "coalesce" function but it didn't work, we are getting an data flow error at the time of ingestion. However, in order to replace the empty the below formula works as excpected over the calculated field.

iif(matches_regex(COLUMN NAME,"[^null$]" ),COLUMN NAME,"testvalue@email.com")

View solution in original post

2 Replies

Avatar

Level 4

Hi @jayakrishnaaparthasarathy ,
Firstly, Identity fields are only required if you building real-time customer profiles. They are not required if you are only ingesting data into the data lake. Second, if you get into a situation where you can't afford values to be null you can make use of "coalesce" function which returns first non-null object. IN your case if you want to replace empty email with some default email/string you can try  "coalesce(EMAIL,"defaultEmail@example.com")

Avatar

Correct answer by
Community Advisor

HI @AtulChavan , Thanks for the reply. Firstly, since it is OOTB field it is required to be on the datasets and so it is mandatory to have the data on the list. Also, we have been getting the empty string and not the NULL value. We have also tried with having the "coalesce" function but it didn't work, we are getting an data flow error at the time of ingestion. However, in order to replace the empty the below formula works as excpected over the calculated field.

iif(matches_regex(COLUMN NAME,"[^null$]" ),COLUMN NAME,"testvalue@email.com")