cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for Splitting the nodes based on the field length

0 Kudos

HI All,

Target records Record1 to Record4 must be created based on the length of the source field length i.e, if the source field length is only 90 then only 3 records must be created.maximum length of the source field is 120.The source and the target structure are as shown


Source                                  Target
 
 Record                                Record(30)
      Field(120)    ------------->          Field1(10)
                                                 Field2(10)
                                                 Field3(10)

After mapping:-


        Source         ----------->        Target
 
Record                                Record1(0 to30)
      Field(120)    ------------->          Field1(0 to 10)
                                                 Field2(10 to 20)
                                                 Field3(20 to 30)
                                           Record2(30 to 60) 
                        ------------->          Field1(30 to 40)
                                                 Field2(40 to 50)
                                                 Field3(50 to 60)
                                           Record3(60 to 90)
                        ------------->          Field1(60 to 70)
                                                 Field2(70 to 80)
                                                 Field3( 80 to 90)
                                           Record3(90 to 120)
                        ------------->          Field1(90 to 100)
                                                 Field2(100 to 110)
                                                 Field3(110 to 120)
 


Can any one provide me the code to get this done.

Thanks ,

Vikram

Accepted Solutions (0)

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

You need no UDF. You can use the substring function, but you should check the length of the string to prevent mapping errors due to the substring function.