cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping query

Former Member
0 Kudos

Hi all,

Have a queue as shown in the figure with 3 contexts each consisting of 2 values.I want as output the 2nd value from the contexts.(That is 120,6,6).The 2nd value from contexts.

[http://i54.tinypic.com/24onm89.jpg]

Is there any way to achieve it using standard mapping functions.

Thanks

K

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

the link is broken

Former Member
0 Kudos

The queue looks as follows:

SUPRESS
10
120
CC
0
6
CC
0
6
FinalContext

former_member191531
Participant
0 Kudos

Hi,

please try this:

TargetField --> index [1,1] --> equalsA --> ifWithoutElse --> SourceField

The second value for equalsA is 'Constant [2]'.

The value for if = true is the TargetField again.

Sorry, it's not so easy to describe a graphic...

Regards,

Juergen

GabrielSagaya
Active Contributor
0 Kudos

input>removecontext>myudf-->Target

function myudf(String a[[]], ResultList result, Container container)

{

for (int i=1;i<a.length;i+=2)

if (!a[<i>].equals(RESULTLIST.CC))

result.addValues(a[<i>]);

}

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

input>removecontext>myudf-->Target (myudf --> all values of a queue)

function myudf(String a[[]], ResultList result, Container container)

{

result.addValue(a[1]);

for (int i=2;i<a.length;i++)

if (!a<i>.equals(RESULTLIST.CC))

result.addValues(a[i+1]);

i++;

}

see that the forum replace the [

Edited by: Rodrigo Alejandro Pertierra on Sep 7, 2010 12:04 PM

Former Member
0 Kudos

Thanks all....

Answers (0)