cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with graphic-mapping

AlexanderApel
Participant
0 Kudos

Hi Experts,

I have an issue while mapping one field in PI and maybe you can help me.

Source:

I have two segments with Value “1”  in field “Nr”( transaction number) but only one of them have an entry in field “CardID”

Target:

I need a mapping which ist copy the value from “CardID” when “Nr” is the same.

Thanks and best regard,

Alex

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,


Target:

I need a mapping which ist copy the value from “CardID” when “Nr” is the same.

Without providing the source fields and their hierarchy, it would be hard to recommend a solution.

For example, in your source XML, 4711 exists only once but has two rows for Nr, in that case you can use the node function useOneAsMany to multiply 4711 to Nr to produce two 4711's. Concat would also work in this case.

Regards,

Mark

AlexanderApel
Participant
0 Kudos

Hi Mark,

my source and target files has the same structure

former_member184720
Active Contributor
0 Kudos

I agree with mark..

what if the first value is blank?

would there be any situation where in same Nr can different cardID's?

However please check below mapping if it helps returns previous occurrence

f1 -> Nr

f2 ->CardID

AlexanderApel
Participant
0 Kudos

thanks a lot !!!

it works fine

Answers (2)

Answers (2)

azharshaikh
Active Contributor
0 Kudos

Hi Alex,

I dnt think Graphical mapping will suffice (might get complex)

Instead write a UDF..and loop through values for Nr and CardID

If Nr is same you need to write the same value for CardID else take the nxt value.

Regards,

Azhar

AlexanderApel
Participant
0 Kudos

can you give me an example to do this?

my java skills are not the best

Dimitri
Active Contributor
0 Kudos

Try using CreateIf or other functions provided to meet your requirements

AlexanderApel
Participant
0 Kudos

and here is my Problem, i dont knwo how