This content has been marked as final. Show 4 replies
Because your sort order is probably set to binary (PeopleTools options page). From the PeopleBooks:
The type of sort done by this function, that is, whether it is a linguistic or binary sort, is determined by the Sort Order Option on the PeopleTools Options page.
on PeopleTools > Personalization > Personalization Options can see the sorting setting
you are sorting an array of strings. Therefore, the sort will be done based on the ASCII character code. Alpha and numeric characters are handled in the same way. The ascii character code for 1 = 49 and for 8 = 56.
So, in your example firstname.lastname@example.org->email@example.com becuase the number 49 naturally comes before 56. in sorting strings no differentiation is made between alpha and numeric characters.
imagine you were sorting the following strings. What would you want the sort behaviour to be? Logically an ascii based sort would produce a sort order that may not match what a human might illogically want.
To my knowledge... there is no way to control the behaviour of this kind of sorting in PeopleTools.
There may be a way to break out of PeopleCode and do a sort in Java. http://stackoverflow.com/questions/104599/sort-on-a-string-that-may-contain-a-number
Thanks for the reply,
I just may sure there is not space between my sorting string to deal with the problem. my questions is why??
in ASCII space is 32 letter is 65 to 90 and 97 to 122, how come the space can cause the sorting problem???