cancel
Showing results for 
Search instead for 
Did you mean: 

Mappng the number of occurrences of the node

Former Member
0 Kudos

Hi ,

The target structure in the mapping I am working on is like this

LIST/S_UNB/S_UNH

LIST/S_UNB/S_UNH/D_0062

The mapping requirement is like the number of occurrences of the UNH segment should be assigned to 0062

Example:

First Occurrence of UNH:

UNBUNOA:2AMAZONRecvMsgB:RQMB:381050110509:1653105091653532+IN810'

UNH+ 1+ORDERS:D:96A:UN:EAN008'

BGM2201105060039NA'

DTM+137:20110506:102'

Second Occurrence of UNH

UNBUNOA:2AMAZONRecvMsgB:RQMB:381050110509:1653105091653532+IN810'

UNH2ORDERS:D:96A:UN:EAN008'

BGM2201105060049NA'

DTM+137:20110506:102'

Third Occurrence of UNH

UNBUNOA:2AMAZONRecvMsgB:RQMB:381050110509:1653105091653532+IN810'

UNH3ORDERS:D:96A:UN:EAN008'

BGM2201105060059NA'

DTM+137:20110506:102'

And so on...

I tried this way

Constant->Index(1,1)---->0062

But it did not work.

Please help me.

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Try this..!!

*Source element*(that is being mapped to LIST/S_UNB/S_UNH)------->*Count*------->*LIST/S_UNB/S_UNH/D_0062*

Regards,

Ramana.

Former Member
0 Kudos

Hi Ramana,

Thanks for the quick reply.

*Source element*(that is being mapped to LIST/S_UNB/S_UNH)------->*Count*------->*LIST/S_UNB/S_UNH/D_0062*

But here,I have mapped the UNH node to the constant.

So,what will the mapping?

Please help me.

Thanks in advance

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Constant->Index(1,1)---->0062

Please use


UNH -> removeContext -> index(1,1) -> 0062

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark,

Thanks for the quick reply.

UNH -> removeContext -> index(1,1) -> 0062

Means,0062 comes under UNH that is at the target .

Please help me.

Thanks in advance

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Instead of UNH, use index on what is your logic in forming UNH so that it gets counted properly.

e.g logic for counting generating unh -> removeContext -> index -> target.

Hope this helps,

Mark