It will be great if you could share an example app. However, be careful when using dual function with sorting purpose:
Dual function help: "When several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered."
I created a sample app that should show what I am referring to.
The tables that are using the dual() dimension function properly, but they do not sort alphabetically according to the string field. The tables that use the name field sort correctly, but it groups together people with the same name even if they have different IDs.
I also tried creating a Dual field in the load script, but it did not help.
Dual() combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes.
so sorting a dual value alfabetically, comes to sorting it numerically.
if you want to use the text value for sorting, you'll have to use an expression using the text dimension