cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Help required ...!!

Former Member
0 Kudos

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  .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (4)

Answers (4)

former_member191435
Contributor
0 Kudos

Hi Aziz,

Can you please elaborate ur Question.

If you want only the queue purposeu can directly map with Item2[] Context.

Thanks,

Sreenivas 

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Aziz,

This is probably not the best code, but it will work:

Hope this helps,

Mark

praveen_sutra
Active Contributor
0 Kudos

Hi Aziz,

PFB the code . You can use splitbyvalue node function with properties as change on value change as shown in the second image after the UDF.

thanks and regards,

Praveen T

Former Member
0 Kudos

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