DimensionSortOrder is used to sort a dimension from within a Turbo Integrator (TI) process.
Syntax of DimensionSortOrder
DimensionSortOrder ( DimName , CompSortType , CompSortSense , ElSortType , ElSortSense); where:
- DimName, is the dimension to be sorted.
- CompSortType, sets the order for Consolidated elements.
- ByInput (the order used is the order the elements were added to the dimension) or
- ByName (the order used is alphabetic on the field chosen).
- CompSortSense, Ascending or Descending
- ElSortType, sets the order for N level elements.
- ByInput (the order used is the order the elements were added to the dimension),
- ByName (the order used is alphabetic on the field chosen),
- ByLevel (sorts the elements by level), or
- ByHierarchy (sorts the elements by hierarchy).
- ElSortSense, Ascending or Descending either alphabetically or by level
Use of DimensionSortOrder
DimensionSortOrder will normally be used to re-sort a dimension’s default order after an element has been added using DimensionElementInsert.
Why is this useful? Often we end up with many elements in a dimension and they appear to the user in an unsorted mess. this forces the dimension to be sorted in a manner that is useful to the end user. It is especially handy when you have a long dimension with a single consolidation element.
Example of Use
DimensionSortOrder ( cDim, ‘ByName’, ‘Ascending’ , ‘ByName’ , ‘Ascending’ );
where cDim has already been defined as the dimension we are working with in the TI. This will sort both consolidation and N level elements in this case ascending by name.