Setting the default sort order
The sort order of a field will usually default to numeric or text order. Sometimes, this is not what we want because neither may be appropriate for a particular field. We can use a custom sort based on an expression but that adds an additional overhead to the frontend.
The most performant sort is the Load Order sort option. However, we cannot always rely on the order in which that data may have been loaded.
In this recipe, we will show how we can default that sort order.
Getting ready
Load the following script:
Data: LOAD * INLINE [ Country, Rank France, Low Ireland, Low Germany, High USA, High UK, Med Japan, Med ];
How to do it...
Follow these steps to set a default sort order:
Add a listbox for
Country
and one forRank
. Note thatRank
defaults to aHigh
,Low
, or Medium text order.Edit the script. Before the data table load, add the following code:
Temp: Load * INLINE [ Rank High Med Low ];
After the data table load, add the following code:
Drop...