Don't you mean:
Substitute ( List ( RelatedTable::TargetField ) ; ¶ ; "-" )
otherwise, there's no need for the List function here.
assuming that you are listing values from a set of related records, you can define the desired sort order in the relationship to the related table. Then the list function will return the values from the related table sorted in the order specified by your relationship.
If by anychance, you have a checkbox formatted field or other text field containing the list of values, the list function does nothing in your calcualtion. You may then want to replace this single field with a related table as that can make it easy to get your values sorted in the desired order.
I have a similar question about the sorting.
Set Field [MainTable::Combine; List (RelatedTable::DesiredField)]
to capture page numbers for an index. I checked and do have the portal sorting numerically from low to high, but the numbers are not following the order. I can see the portal as I work and they are definitely sorting.
See screenshot attached.
Thanks for any help!
Try changing how the records are being sorted in the relationship.
File>Manage>Database & go to the Relationship Tab. Edit your relationship between your MainTable and your RelatedTable. On the right hand side below your RelatedTable check the box for "Sort Records" and select the field you want to sort by.
Hope this helps!