cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting with 2 conditions (Message Mapping)

0 Kudos

<Group>

<Recs>

<Name> Name2 </Name>

<Grade> F71 </Grade>

</Recs>

<Recs>

<Name> Name1 </Name>

<Grade> O98 </Grade>

</Recs>

<Recs>

<Name> Name5 </Name>

<Grade> O96 </Grade>

</Recs>

<Recs>

<Name> Name1 </Name>

<Grade> G87 </Grade>

</Recs>

</Group>

<Group>

<Recs>

<Name> Name3 </Name>

<Grade> O100 </Grade>

</Recs>

<Recs>

<Name> Name4 </Name>

<Grade> G85 </Grade>

</Recs>

</Group>

I need to sort the names alphabetically based on their grade with O being the highest and F being the lowest meaning if Name2 has a grade of F71 and Name1 has a grade of O98, then it’s still Name1 which will be first on the target message when queue is displayed. Another condition is if there are duplicates with names but with different grade in the record, the name with the higher record will be displayed on the target message. Let’s say for Recs1, there are two Name1 values. One with an O98 and the other with G87. Therefore, Name1 with O98 will be in the target message once tested.

Please help. Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

peter_karg
Explorer
0 Kudos

Hi Dianne,
I'm not sure if I really got your whole request. I have created a mapping which should have this result

sorted by Grade descending and removed duplicate names. result can be splitted in more fields.

Hope this helps or gives you some idea..
regards Peter