Sort Objects

The sort objects are used to sort the query result. They can be dimensions, attributes or measures. Result objects can be used as sort objects. This mainly depends on the query capabilities of the universe.

<sortObjects>
    <sortObject id="string" path="string" sortType="Ascending|Descending"/>
Attribute Type or Value Description
id string The object identifier, defined when retrieving the data source metadata
path string The full path of the object in the universe. Optional.
sortType Ascending|Descending The sort type

Example

The following snippet of a query specification shows the sort objects used in the query for a UNX universe. Two of them are also defined as result objects.

<query xmlns="http://www.sap.com/rws/sl/universe" id="9168123992538053733" dataSourceType="unx" dataSourceId="5808">
    <querySpecification version="1.0">
        <queryOptions>
            ...
        <queryOptions>
        <queryData>
            <resultObjects>
                <resultObject path="Product|folder\Category|dimension"
                    id="_IB8eG7IhEeCk0Ylv-tlF2Q"/>
                <resultObject path="Product|folder\Product|dimension"
                    id="_IB8eGbIhEeCk0Ylv-tlF2Q"/>
                <resultObject path="Time|folder\Calendar|folder\Calendar Year Month|dimension" 
                    id="_IBo8G7IhEeCk0Ylv-tlF2Q"/>
                <resultObject path="Inventory|folder\Stock Level|measure"
                    id="_IB8eFrIhEeCk0Ylv-tlF2Q"/>
                <resultObject path="Product|folder\Minimum Stock|measure"
                    id="_IB8eHrIhEeCk0Ylv-tlF2Q"/>
            </resultObjects>
            <sortObjects>
                <sortObject sortType="Ascending" path="Product|folder\Category|dimension"
                    id="_IB8eG7IhEeCk0Ylv-tlF2Q"/>
                <sortObject sortType="Ascending" path="Product|folder\Product|dimension"
                    id="_IB8eGbIhEeCk0Ylv-tlF2Q"/>
                <sortObject sortType="Descending" path="Time|folder\Calendar|folder\Calendar Week
                    |dimension" id="_IBo8HLIhEeCk0Ylv-tlF2Q"/>
            </sortObjects>
        </queryData>
    </querySpecification>
</query>