Custom Filters - Constant Comparison Filters

<filterPart>
    <comparisonFilter id="string" path="string" operator="string">
        <constantOperand searchPattern="Boolean">
            <answerValue dataType="String|Numeric|Date">

For each <comparisonFilter>, you can add up to two <constantOperand>. Each operand contains an <answerValue> that represents the constant value used as right operand.

Comparison Filter
Attribute Type or Value Description
id string The identifier of the object used as left operand
path string The full path of the object in the universe
operator string (values in table below) The operator
Operator operator Attribute Value Number of Right Operands
Is Null IsNull Zero
Is Not Null IsNotNull Zero
Equal To (=) EqualTo One
Not Equal To (<>) NotEqualTo One
Less Than (<) LessThan One
Greater Than (>) GreaterThan One
Less Than or Equal To (<=) LessThanOrEqualTo One
Greater Than or Equal to (>=) GreaterThanOrEqualTo One
Like Like One
Not Like NotLike One
Except Except One
Between Between Two
Not Between NotBetween Two
Both Both Two
In InList List
Not In NotInList List
Constant Operand
Attribute Type or Value Description
searchPattern Boolean Specifies how the <answerValue> value is parsed without knowing the escape and mask characters of the underlying database. Can be used with the Like operator only.

If set to true, the <answerValue> value is parsed:

  • The * character is replaced with the multicharacter mask of the database in the resulting SQL.
  • The ? character is replaced with the single-character mask of the database in the reuslting SQL.
  • If the pattern contains \? or \*, then ? or * are escaped. Strings containing ? or * are actually found by the operator.
  • The _ and % wildcard characters are escaped.

If set to false, the value is not parsed. Default is false.

Answer Value
Attribute Type or Value Description
dataType String|Numeric|Date The data type of the value used as filter

Example

Is Null Operator (No Constant Operand)

The following snippet of a query specification shows an IsNull comparison filter with no constant operand in the query.

<query dataSourceId="5909" dataSourceType="unx" xmlns="http://www.sap.com/rws/sl/universe">
    <querySpecification version="1.0">
        <queryData>
            <resultObjects>
                <resultObject id="_IBo8M7IhEeCk0Ylv-tlF2Q" path="Customer|folder\Geography|folder\Continent|dimension"/>
                <resultObject id="_IBo8NrIhEeCk0Ylv-tlF2Q" path="Customer|folder\Geography|folder\Country|dimension"/>
            </resultObjects>
            <filterPart>
                <comparisonFilter id="_IB8eVbIhEeCk0Ylv-tlF2Q" path="Sales Orders|folder\Number of Orders|measure" 
                    operator="IsNull"/>
            </filterPart>
        </queryData>
    </querySpecification>
</query>

Example

Equal To Operator (One Constant Operand)

The following snippet of a query specification shows an EqualTo comparison filter with one constant operand in the query.

<query xmlns="http://www.sap.com/rws/sl/universe" id="5897899822041415615" dataSourceType="unx" dataSourceId="5808">
    <querySpecification version="1.0">
        <queryOptions>
            ...
        </queryOptions>
        <queryData>
            <resultObjects>
                <resultObject path="Customer|folder\Geography|folder\Continent|dimension" id="_IBo8M7IhEeCk0Ylv-tlF2Q"/>
                <resultObject path="Customer|folder\Geography|folder\Country|dimension" id="_IBo8NrIhEeCk0Ylv-tlF2Q"/>
                <resultObject path="SalesOrders|folder\Number of Orders|measure" id="_IB8eVbIhEeCk0Ylv-tlF2Q"/>
            </resultObjects>
            <filterPart>
                <comparisonFilter operator="EqualTo" path="Time|folder\Calendar|folder\CalendarYear|dimension"
                    id="_IBo8FLIhEeCk0Ylv-tlF2Q">
                    <constantOperand>
                        <answerValue dataType="String">2011</answerValue>
                    </constantOperand>
                </comparisonFilter>
            </filterPart>
        </queryData>
    </querySpecification>
</query>

Example

Between Operator (Two Constant Operands)

The following snippet of a query specification shows a Between comparison filter with two constant operands in the query.

<query dataSourceId="5909" dataSourceType="unx" xmlns="http://www.sap.com/rws/sl/universe">
    <querySpecification version="1.0">
        <queryData>
            <resultObjects>
                <resultObject id="_IBo8M7IhEeCk0Ylv-tlF2Q" path="Customer|folder\Geography|folder\Continent|dimension"/>
                <resultObject id="_IBo8NrIhEeCk0Ylv-tlF2Q" path="Customer|folder\Geography|folder\Country|dimension"/>
                <resultObject id="_IB8eVbIhEeCk0Ylv-tlF2Q" path="Sales Orders|folder\Number of Orders|measure"/>
            </resultObjects>
            <filterPart>
                <comparisonFilter id="_IB8eVbIhEeCk0Ylv-tlF2Q" path="Sales Orders|folder\Number of Orders|measure" 
                    operator="Between">
                    <constantOperand searchPattern="false">
                        <answerValue dataType="Numeric">200</answerValue>
                    </constantOperand>
                    <constantOperand searchPattern="false">
                        <answerValue dataType="Numeric">700</answerValue>
                    </constantOperand>
                </comparisonFilter>
            </filterPart>
        </queryData>
    </querySpecification>
</query>