cancel
Showing results for 
Search instead for 
Did you mean: 

Else if mapping

Former Member
0 Kudos

Hi All,

I have a field at source side as CREATED_BY which is need to map to CREATED at target side. I need the solution for below logic

if first 2 letters of CREATED_BY is AM

then CREATED = Telus

elseif first 2 letters of CREATED_BY is LV

then CREATED = TELUS US

elseif first 2 letters of CREATED_BY is MO

then CREATED = Concentrix.

if none of this condition is met the map with default value which is Telus.

Can anyone suggest me should I go for UDF or I can achieve the functionality by standard functions provide by message mapping. If it can be achieved by standard function then please provide complete the solution. Your help is highly appreciated

how to create UDF for above logic?

Regards

Faisal

Edited by: Abdul Faisal on May 27, 2010 11:26 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You can go with UDF. create a udf with the argument "str" and use the below code.

Source> UDF>Target



if(str.equals("AM")) {
   return "Telus";
}else if(str.equals("LV")) {
   return "TELUS US";
}else if(str.equals("MO")) {
   return "Concentrix";
}else{
  return "Telus";
}

Regards

Ramg

Former Member
0 Kudos

Hi Ram,

Thanks for the reply.. Can you provide me the parameters needed for the UDF. what shall be the return parameter?

Thanks

Faisal

Edited by: Abdul Faisal on May 27, 2010 11:42 PM

Former Member
0 Kudos

Hi

Just you need to add 1 parameter (input) : str

Assign the argument as --- str

Regards

Ramg

Edited by: Ramkumar Ganesh on May 27, 2010 8:15 PM

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

substring(2) - fixvalues

should help

if you could empty string also:

concat (constant(2 spaces)) - substring(2) - fixvalues