Add a condition to your sort field calculation to return a string like "zzz" if the result of the previous calculation steps (i.e. the pertinent field as per sort field selection) is empty.
Thanks. I had tried that (using Char(255) for blank values) -- but, for some reason, I couldn't get it to work. I don't remember exactly how I coded it. Perhaps the nesting of the conditions was too complicated. This time I just did simple If() statements for each test for a blank value and nested them into the Case() statement and it worked fine.
Well, the entire purpose of your calculation field is to calculate a final value; it should be sufficient to just check that value, instead of scrutinizing each intermediate step.
For example …
Let ( [
sf = globals::gSortField ;
sc = Case (
sf = "Name" ; name ;
……… // other fields with type conversion etc.
Case ( IsEmpty ( sc ) ; "zzz" ; sc )