cancel
Showing results for 
Search instead for 
Did you mean: 

How to get occurance value

Former Member
0 Kudos

Hi,

How to get 1 , 2 and 3rd occurance value?

ex:Source

-


E1EDP10

E1EDP16

a

b

c

Whenever E1EDP16 repeates (duplicate segments are there). Once I need to send in target element the 1st occurance of E1EDP16/a value, send time I need to send the send occurance of E1EDP16/a value, and as on...

How to achive this.

regards,

Ansar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I will clarify more...

my source structure is like this:

-


E1EDP10

E1EDP16

a

b

c

E1EDP16

a

b

c

E1EDP16

a

b

c

My Target structure:

-


SEG1

SEG2

X

Y

Z

-- Here I need to send from E1EDP16 /a (source) value to SEG2/X (target).

here E1EDP16 repeats 3 times..Now I want to send only 2nd time of E1EDP16/a value to target. How to achive this.?

thx in adavnce...

Former Member
0 Kudos

If this is your

Source structure :

E1EDP16

a

b

c

E1EDP16

a

b

c

E1EDP16

a

b

c

and you want to create target structure as...

Target Stucture

SEG2

X

Y

Z

SEG2

X

Y

Z

SEG2

X

Y

Z

....

If this is what you want map E1EDP16 to SEG2

E1EDP16>a to SEG2>x

E1EDP16>b to SEG2>y

E1EDP16>z to SEG2>z

In this case corresponding values will be mapped to respective occurences

Message was edited by:

Yomesh P Sharma

Former Member
0 Kudos

HI SHARMA,

I need to send 2nd latest value to target...

Suppose E1EDP16/a repeats 3 times

then I need to send only 2nd time value to the target. I dont want to send 1 and

3rd values.

regards,

Ansar.

Former Member
0 Kudos

This can be done by using a UDF.

Provide complete queue of source to UDF, have a for loop which loops through the queue and takes only second value and fills it in resultlist. Pass the result to your target..

example ......

getSecondValue(sourcefield)

{

for(source=0; source <= 1; source ++ )

{

result = sourcefield[1];

}

}

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ansar,

You want to map multiple occurence of source node to target node. For this only prerequisite is your target Node should also be 0..unbounded occurence.

If this is true then just map E1EDP16 directly to target node. XI mapping works on queues, the queue of E1EDP16 will have all the value with context change. The same queue will be use to create target node. Hence you will get multiple target nodes.

Regards,

Yomesh.

Former Member
0 Kudos

To check how the mapping for a particular node is working, after mapping it and providing sample test data in test TAB , right click on source or target node and click "Display Queue" option.

This will help you in analysing how mapping works.

Former Member
0 Kudos

Hi,

What exactly u need? if u want occurence value then,u can only set 0..1 or 1..1 or 0..Unbounded only.if u want the occurence as 0..3 will not be possibe.give the occurence as 0..unbounded and it will occur how mnay times the source value will come.

Regards,

Phani

Reward Points if Helpful