cancel
Showing results for 
Search instead for 
Did you mean: 

Help with mapping1

Former Member
0 Kudos

Hi,

http://farm3.static.flickr.com/2446/3757050996_d92374d81c_o.png

In the above mapping screen shot, field2 can have values like...

<root>

<field>AVG</field>

</root>

<root>

<field>AV</field>

</root>

<root>

<field>KCM_IOQ</field>

</root>

<root>

<field>KCM</field>

</root>

<root>

<field>AVGK</field>

</root>

I have to check for field2 == "KCM_" and only one occurrence value for field2 KCM_ comes like this. otherwise field2 will have max of 4 char string. so if I specify substring of 0,4 it is generating OutOfBounds exception for values less than 4.

Here I need to pick up the field KCM_IOQ only out of the mapping.

Thanks,

Venkat.

Edited by: Venkat A on Jul 25, 2009 11:34 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos
I have to check for field2 == "KCM_"

You can do this without using a UDF/ substring function

Use the standard startsWith (Text Function).....check for "KCM_"....will return true/ false....then map to if function and have your Then/ Else logic accordingly

Regards,

Abhishek.

Answers (1)

Answers (1)

Former Member
0 Kudos

I would write a UDF to pass the string & obtain the Output as true/false. This would eliminate OutOfBounds Exception (for any digit input)...

boolean b = string.startsWith("KCM");

if(true){//Add the required substring to the output}

-Siva Maranani