You need to get the value of that variable via your SQL rather than via the subreport. The subreport gets processes during a formatting stage (report pass) when it's too late to sort. Hence, the shared variable can't be used as a basis for sorting.
If you explain the situation in more detail, it may be possible to suggest an appropriate SQL approach.
Cheers,
- Ido
p.s. If this is a one-time report, you could also export the data from the report, and use this processed data as the basis for a second report where the data can easily be sorted based on any of the resulting columns.
Awkward, but doable...
ixm7@psu.edu