Skip to Content

Dilemma with the SortByKey Function !

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

sortbyKey.JPG (65.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Feb 18, 2014 at 08:14 AM

    Is in ascending order by default

    30 --> 12

    110 --> 64

    40 --> 200

    10 --> 288

    ...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 18, 2014 at 08:09 AM

    Hi Sam

    Which are the unexpected results?

    Regards

    Javi

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 18, 2014 at 08:10 AM

    Hi Sam,

    Double-click the sortByKey and then choose ascending order.

    Regards,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2014 at 08:15 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.