on 07-21-2013 8:02 AM
Hi Experts ,
I am trying to write an UDF to achieve below logic ,
input value is like
Item 1[]
a
b
c
d
Item 2[] has below values
a
b
b
c
d
d
then Item 1 values equal to Item 2 then i should get the result as given below
Result[]
=============
a
<Context change>
b
b
<Context change>
c
<Context change>
d
d
end of line
==================
how can achieve this logic using UDF .
Hi Aziz,
As per your requirement, 2 things need to be done.
1. To check whether the values in second queue, belongs to any one of them in first queue.
2. To change the context as per the changed value.
To achieve the 1st requirement, you can use this UDF just to match the values. You can add different conditions
This UDF will validate the data based on the 1st queue
The second part you can do it directly by SplitValue function.
Note: This context change can be done through the UDF also, but you need to add few conditions again.
Output:
========================
Hope this will help you
Regards,
Sourav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aziz,
Can you please elaborate ur Question.
If you want only the queue purposeu can directly map with Item2[] Context.
Thanks,
Sreenivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After trying out few more times i finally got the code right .
int c = 0;
String str = null;
for(int i=0;i<palletno.length;i++)
{
if(c==1)
result.addValue(ResultList.CC);
for(int j=0;j<sccno.length;j++)
if (palletno[i].equals(sccno[j]))
{
str = (sccno[j]).toString();
c=1;
result.addValue(str);
}
}
}
==========================================
This works fine for me ...
Regards,
Aziz khan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.