<filterPart>
<rankingFilter function="Top|Bottom|topPercent|bottomPercent" level="integer">
<prompt>
<dimension id="string" path="string"/>
<basedOnMeasure id="string" path="string"/>
<rankedByDimensions>
<rankedByDimension id="string" path="string"/>
<filterPart>
The ranking filter is defined by:
- A ranking order (ascending or descending)
- The question prompted to the end-user if the filter is triggered by a prompt
- The dimension and measure to rank
- The additional dimensions used to rank
- Any additional custom filter it may contain
Ranking Filter
Attribute |
Type or Value |
Description |
function
|
Top|Bottom|topPercent|bottomPercent |
Specifies if the ranking is ascending (Bottom,
bottomPercent) or descending
(Top, topPercent) |
level
|
integer |
The number of values to rank. Optional. In the case of a filter with
prompt, it is the default value of the prompt. This behavior is
specific to UNV universes.
|
Prompt
Element |
Type or Value |
Description |
<prompt> |
string |
Specifies the prompt question in the case of a
filter with prompt |
Dimension
Attribute |
Type or Value |
Description |
id
|
string |
The identifier of the dimension object to
rank |
path
|
string |
Optional.The full path of the dimension
object |
Measure
Attribute |
Type or Value |
Description |
id
|
string |
The identifier of the measure object to
rank |
path
|
string |
Optional.The full path of the measure
object |
Ranked by Dimensions
<rankedByDimensions> is optional. You add at least one
<rankedByDimension> to
<rankedByDimensions>.
Attribute |
Type or Value |
Description |
id
|
string |
The identifier of the additional dimension object
used to rank |
path
|
string |
Optional. The full path of the dimension
object |
Example
Without Prompt
<query dataSourceType="unx" dataSourceId="91800" xmlns="http://www.sap.com/rws/sl/universe">
<querySpecification version="1.0">
<queryData>
<resultObjects>
<resultObject path="Dimcustomer|folder\Regionname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Countryname|dimension" id="_60xHwA-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<resultObject path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</resultObjects>
<filterPart>
<rankingFilter level="3" function="Top">
<dimension path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<basedOnMeasure path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</rankingFilter>
</filterPart>
</queryData>
</querySpecification>
</query>
Example
With a Prompt
<query dataSourceType="unx" dataSourceId="91800" xmlns="http://www.sap.com/rws/sl/universe">
<querySpecification version="1.0">
<queryData>
<resultObjects>
<resultObject path="Dimcustomer|folder\Regionname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Countryname|dimension" id="_60xHwA-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<resultObject path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</resultObjects>
<filterPart>
<rankingFilter level="3" function="Top">
<prompt>Enter the ranking level:</prompt>
<dimension path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<basedOnMeasure path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</rankingFilter>
</filterPart>
</queryData>
</querySpecification>
</query>
Example
With Additional Dimensions
<query dataSourceType="unx" dataSourceId="91800" xmlns="http://www.sap.com/rws/sl/universe">
<querySpecification version="1.0">
<queryData>
<resultObjects>
<resultObject path="Dimcustomer|folder\Regionname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Countryname|dimension" id="_60xHwA-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<resultObject path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</resultObjects>
<filterPart>
<rankingFilter level="3" function="Top">
<prompt>Enter ranking level :</prompt>
<dimension path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<basedOnMeasure path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
<rankedByDimensions>
<rankedByDimension path="Dimcustomer|folder\Regionname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
<rankedByDimension path="Dimcustomer|folder\Countryname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
</rankedByDimensions>
</rankingFilter>
</filterPart>
</queryData>
</querySpecification>
</query>
Example
With a Predefined Filter
<query dataSourceType="unx" dataSourceId="91800" xmlns="http://www.sap.com/rws/sl/universe">
<querySpecification version="1.0">
<queryData>
<resultObjects>
<resultObject path="Dimcustomer|folder\Regionname|dimension" id="_60xHwQ-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Countryname|dimension" id="_60xHwA-8EeO1RP--CtxScg"/>
<resultObject path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<resultObject path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
</resultObjects>
<filterPart>
<rankingFilter level="3" function="Top">
<dimension path="Dimcustomer|folder\Customer Name|dimension" id="_7Zkd8A-8EeO1RP--CtxScg"/>
<basedOnMeasure path="Custorderline|folder\Quantity|measure" id="_60Bg4g-8EeO1RP--CtxScg"/>
<filterPart>
<predefinedFilter path="Filters|folder\European Customers|filter" id="_9onvcA-8EeO1RP--CtxScg"/>
</filterPart>
</rankingFilter>
</filterPart>
</queryData>
</querySpecification>
</query>