I want to sort email documents in the all documents view by a field with numerical value of a field. So I create a filed dvalue with date type “number” in the memo form. Then add a new column in views–$All. This column sort documents in ascending order. The values of the column is assigned by formula—@Text(dvalue). The field value of four emails are 0.12,0.2,12. By a click on the column, the sorting result is 0.12, 0.2, 12, 8. My question is why the sorting result is not in asending order according to the filed value. If I want to sort the email documents, what should I do.
Thanks for any suggestion, example, or source code.
BTW, I am a newbie to lotus application, could you do me a favor by providing more details.
Subject: RE: how to sort email documents by the numerical value of a field?
Yes, I make the column formula as dvalue. And the value of four documents are 15, 2, 11, 12, 0.12. But the sorting result is 0.12 , 2, 12 ,15 , 11 . My God, what should I do with this?
Subject: how to sort email documents by the numerical value of a field?
Since you have set the column value to @Text(dvalue) it sorts alphabetically and the result is correctly displayed (You get “12” before “8” since 1 has a lover ascii value than 8).Just set the column value to dvalue and things should work fine.
Subject: RE: how to sort email documents by the numerical value of a field?
Look at the code that creates the field dvalue. That code is assigning a text value into the field.
It makes no difference that dvalue is defined as numeric on the form. When you assign a field using a formula or agent, that overrides the datatype on the form. The form does not matter unless you edit the document. Even then a computed field will be stored with the datatype returned by its formula, not the datatype given on the form.