Rupesh
Rupesh

Reputation: 31

Sorting column in both way in Lotus Notes

I have a Main field which consist the value of 10 other fields for each document , when I tried to sort this field value in the view column using the column sorting properties I didn't get the desired result.

Here is the example how value is displaying - 10.other 10.other 1c.NSR 10.others 1c.NSR 2b.First in Fab 10.other 10.other

it should display like.

10.other 10.other 10.other 10.other 10.other 1c.NSR 1c.NSR 2b.First in Fab

Any suggestion will be appreciable...... Rupesh

Upvotes: 1

Views: 1718

Answers (1)

angryITguy
angryITguy

Reputation: 9551

Sorting in columns treats values as strings, unless you explicitly treat them as numbers. That means field values that look numeric are sorted as strings. Which doesn't come out in numerical order. A simple way to address this is to format your numbers with zero (0) prefixes, like 01, 02, 03 etc... otherwise your sorted order will look something like 1, 10, 2, 20, 3, 30 and so on.

Firstly, ensure that the "main" field that contains the values of the "10 other fields" is a a multi-value field. You can check this on the form design and looking at the field properties and enable the "Multiple Values" check box. This only works for documents you have not yet created. If you already have documents with the main field that is not multi-valued, then you can fix it in the column by "exploding" the value by adding this formula to the column you are sorting on.

@explode(main;",");

and then open this column's properties dialog box, goto second tab, then enable "Show multiple values as separate entries" check box. Ofcourse, enable the ascending /descending sort preference as you require. Hopefully the sorting will work the way you expect.

Upvotes: 1

Related Questions