on 04-23-2007 2:40 PM
Hi,
My source structure look like
Node1
--- Field1
--- Field2
--- Field3
--- Node2
-- Field4
-- Field5
-- Field6
How to eliminate the duplicate records from the above source structure of six fields of combination.I have tried with in graphical mapping but unable to do it.
Can any one provide a sample udf.
Thanks in advance
Regards
Tiger Woods
Hi
Thanks for your replies,
The given UDF is looking for the duplicate values to one field only,I want to eliminating the duplicate values for all the combination of all fields values.For ex we have the data like
1,2,3,4,5,6
10,20,30,40,50,60
1,2,3,4,5,7
10,20,30,40,50,60
From the above test data we have three unique data records 4th record should be ignore.
Regards
Tiger Woods
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I am not a java expert,could you please provide a UDF for this requirement..,
Regards
Tiger Woods
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
i can give you for one field try to use it for your actual requirement..
see if input is field1 with multiple values then see the below UDF
field1removecontextUDF -- Splitbyvalue--target node
in UDF -- select type as queue
Vector vfield1 = new Vector();
for(int i = 0; i , field1.length;i++){
if(!vfield1.contains(field1(i))) vfield.add(field1(i));
}
Collections.sort(vfield);
for(int j =0;vfield.size;j++){
result.addValue((String)vfield.get(i));
}
Regards
Chilla
<i>reward points if it is helpful..</i>
HI,
Suppose , if you have the above structure under root node with multiple occurrences ,
root --- 0..unbound
Node1
--- Field1
--- Field2
--- Field3
--- Node2
-- Field4
-- Field5
-- Field6
So write a UDF and map to root to target root,
In UDF
take all into a Vector,
and while adding into the vector check the record structure is there or not if it is not existed the add to result
Regards
Chilla
<i>reward points if it is helpful..</i>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.