1. Felix Kock
  2. PowerBuilder
  3. Tuesday, 19 March 2024 10:06 AM UTC

Hello Appeon Team,

we've got a feature request regarding the sort-algorithm and the sort arguments.

We need it to be possible to set a natural sort in the setSort()-Function, instead of the alphanumerical ascending/descending in string type columns.

I.e.: The current sort argument "column a" sorts by alphanumerical values in order of the symbols found.
The strings "A", "B", "1", "2", "10", "20" would get sorted as: 1, 10, 2, 20, A, B

We need an option, which could be something like "column an" (n denoting the natural sort), in which multiple numerical digits are treated and sorted as one number.

This option would sort the above set as: 1, 2, 10, 20, A, B

Reference: https://en.wikipedia.org/wiki/Natural_sort_order

Greetings,
Felix

Sivaprakash BKR Accepted Answer Pending Moderation
  1. Tuesday, 19 March 2024 12:58 PM UTC
  2. PowerBuilder
  3. # 1

Currently no such facility available in PB natively.  One workaround could be

1.  Pad the numerical value with zeros so that the length of all values is same.  ie.  1 becomes '0001', 2 becomes '0002' and so on.
2.  For alphabtical values, just leave it as such.  If the sort order is not as you expected, prefix with spaces.
3.  Store the resultant value in another computed column in the datawindow
4.  Sort the computed column.

HTH

Happiness Always
BKR Sivaprakash

 

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 19 March 2024 11:18 AM UTC
  2. PowerBuilder
  3. # 2

Hi.

This is an enhancement request. You should submit such enhancements requests to Search Bugs | Appeon.

Andreas.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.