cancel
Showing results for 
Search instead for 
Did you mean: 

Dilemma with the SortByKey Function !

former_member216332
Participant
0 Kudos

Hello Experts,

I have a situation which seems really simple but have consumed a lot of my time. The requirement is to sort the INDEX with respect to PartsQuantity in ascending order. Well, I tried the below mapping which seemed obvious to me. But I got some unexpected results !! Can someone please walk me through whats wrong with the below mapping or suggest what can be done to rectify the problem ! It'd be really helpful.

Thanks in Advance

Sam

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Sam,

  In your diplay queue result the index is sorted with respect to ascending order of PartQuantity values. If you check the values of PartQuanity, the smallest value is '12' and the corresponding index value is '30' which is on top in your result list, which is a correct output as per sortbykey function.

Amol

javier_alcubilla
Contributor
0 Kudos

Is in ascending order by default

30 --> 12

110 --> 64

40 --> 200

10 --> 288

...

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Sam,

Double-click the sortByKey and then choose ascending order.

Regards,

Mark

javier_alcubilla
Contributor
0 Kudos

Hi Sam

Which are the unexpected results?

Regards

Javi