on 09-29-2013 6:20 PM
Hello All,
Please help to advice on my below query
I'm trying to compare two queues which will have different lengths, I tried to use the "Compare" function but it didn't work.
my Queue A has following Values
4535001
7835334
3439034
8043043
Queue B has the following
7835334
3439034
8043043
Queue A will always have all the values in "B" but "A" will have more no.of values (Both A and B are removed with contexts)
my result should occur in such a way that, so that it should produce 1supress/null + 3 nodes as below.
<null>/Suppress
7835334
3439034
8043043
I tried to compare and result the value but it is only displaying the existing but not the missing once.
can you guys help to provide a UDF.?
ThankYou
George.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi George,
I am making little change to Mark's code above as it is checking for matching values only for once. Thus if queue B contains multiple matching values of same value as that of queue A then below UDF takes care of the situation. For example
my Queue A has following Values
4535001
7835334
3439034
8043043
1234567
Queue B has the following
7835334
3439034
8043043
8043043
Result
SUPRESS
7835334
3439034
8043043
8043043
SUPRESS
In case this situation arise then the UDF should be like this
for(int a=0;a<inpA.length;a++){
int cnt = 0;
for(int b=0;b<inpB.length;b++){
if(inpA[a].equals(inpB[b])){
result.addValue(inpA[a]);
cnt = 1;
}
}
if(cnt ==0){
result.addSuppress();
}
}
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.