Operator Selection

Sometimes we want the end-user to be able to specify an operator to go with their filter. For example, let's say we want to filter on Quantity Sold. But the user doesn't know the exact number sold, so they want to be able to say that we sold "more than" 2,000 or "less than" 1,000. We can use the Operator Selection feature to achieve this.

To use Operator Selection with Quantity Sold, add it like a regular filter, but include the operator macro:

and ${filterIfNotNull:QUANTITY_SOLD, QUANTITY_SOLD ${operator:QUANTITY_SOLD, $QUANTITY_SOLD$}}

Then add a CustomFilterField with AllowOperatorSelection set to true.

<CustomFilterField>
<FieldRef category="PDF" levelType="Undefined">
<FieldName>Quantity Sold</FieldName>
</FieldRef>
<Type>INTEGER</Type>
<AllowOperatorSelection>true</AllowOperatorSelection>
<SimpleMapping sqlName="QUANTITY_SOLD"/>
</CustomFilterField>

This will give the user the ability to provide an operator, and report will filter accordingly:

images/download/attachments/144836766/selectOperator-version-1-modificationdate-1655932311000-api-v2.jpg

images/download/attachments/144836766/greater-version-1-modificationdate-1655932332000-api-v2.jpg

images/download/attachments/144836766/less-version-1-modificationdate-1655932350000-api-v2.jpg