on 10-20-2009 12:30 PM
Hi
I'm in a need to implement a data validation using UDF or Graphical Mapping
File has the data like ONE header record (5 fileds) and ONE item record (8 fields) as follows
header:field1field2 field3 field4 field5
item:field1field2 field3 field4 field5 field6 field7 field8
header:field1field2 field3 field4 field5
item:field1field2 field3 field4 field5 field6 field7 field8
header:field1field2 field3 field4 field5
item:field1field2 field3 field4 field5 field6 field7 field8
and so on.
Here my requirement is one header should have only one item. Sometimes either header or items are repeating more than one time .. in that case lastest header or item should be updated in target fields.
To say clearly ... one header and one item & one header and one item and so on to be updated.
In case any header has two items then first item to be deleted and second item to be updated.
Kindly advise me how to go about this requirement.
Thanks.
Hi,
Create the UDF of type context by using below code
int l=a.length-1;
result.addValue(a[l]);
Here a is the input parameter.
And map the fields like header>UDF> header (target side) like item and all the fields map.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do the mapping as
Direct assignment of Source header to Target Header and same for fields inside the Header.
create a UDF (choose context).very simple UDF with a single statement.
result.addValue(a[a.length-1]);
Item Node mapping and Its Fields
Item------>UDF------>Item(Target)
field1(Change the context to Header)------->UDF----->field1(under Target Item)
Do the same mapping for remaining fields Under Item as you do for field1
I have tested the above UDF and the mapping..It is working according to your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.