cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Error

Former Member
0 Kudos

Hi,

Can anybody help me on this below mapping problem.

I have a one source field called ITEM and corresponding target field QWERT and my requirement is whenever ITEM field is getting some value it is mapped to the correponding target field and whenever ITEM field is empty I have to send empty string to the target QWERT filed.

And I have done like this...

ITEM>EXISTS> IF WITH ELSE>--> QWERT

for true-->ITEM

for else--> constant ( with one space) given

Here the problem is... it is giving success when ITEM field with some value and It is giving error when the ITEM field with empty string.

Can any body give me the good suggestion to resolve this?? Is it UDF is required this?? If it requires help me on that front??

Cheers.,

xavi

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Xavi,

did this solve your problem?

If yes, please award points.

Dominic

Former Member
0 Kudos

hi ;

Try this UDF

function type context

for(int i=0;i<ITEM.length;i++)

{

if(ITEM<i>.equals("true"))

{

result.addValue(ITEM<i>);

}

else

{

result.addValue(" ");

}

}

ITEM>EXISTS>REMOVECONTEXT --> UDF -->QWERT

Mudit

Former Member
0 Kudos

Hi Mudit,

I don't think it's necessary to use an UDF in this case, the standard function "mapWithDefault" with a blank should solve xavi's problem.

Regards

Dominic

Former Member
0 Kudos

Hi Xavi,

you could use the standard function "mapWithDefault" with an empty string.

Regards

Dominic

Former Member
0 Kudos

Hi

By default it will assingn empty string if the "if" fails. I dont think u need an else

regards

krishna

Former Member
0 Kudos

Murthy,

It doesnt working with your suggestion... I think the problem is with empty stirng and its trims here and it sending to the target field. so can anybody give me the good suggestion.

Xavi