Multi-Value String Mapping

The multiValue attribute allows a developer to accept a delimited value like "Value1;Value2;Value3" from the user. It will then split out the individual values and bind those separately into the report query during execution.

<SimpleMapping sqlName="TITLE" multiValue="true"/>

images/download/attachments/144835560/multiValueString-version-1-modificationdate-1645045893000-api-v2.jpg

This type of mapping must always be used in conjunction with the macro${multiSelectFilter}.

${multiSelectFilter:TEST_STRING, NAME LIKE $TEST_STRING$}


This macro will insert the sql fragment once for each value between the delimiters, combining them with an OR conjunction by default. For example:

(NAME LIKE $TEST_STRING$ OR NAME LIKE $TEST_STRING$ OR NAME LIKE $TEST_STRING$)


You can provide a third optional parameter for the conjunction. Possible values are 'OR' and 'AND', where 'OR' is the default value. Thus the following expressions are equivalent:

${multiSelectFilter:TEST_STRING, NAME LIKE $TEST_STRING$}
${multiSelectFilter:TEST_STRING, NAME LIKE $TEST_STRING$, OR}

AND conjunction example:

${multiSelectFilter:TEST_STRING, NAME NOT LIKE $TEST_STRING$, AND}

The above macro will evaluate to:

(NAME NOT LIKE $TEST_STRING$ AND NAME NOT LIKE $TEST_STRING$ AND NAME NOT LIKE $TEST_STRING$)

In case no value is provided for the param, the macro automatically uses "filterIfNotNull" logic to remove the filter entirely.

Please refer to the javadocs for SqlService for more information on the multiSelectFilter macro.

This feature is only supported for String filter fields.


By default, when multiValue is enabled, it allows a maximum of 5 values. If you want to increase this max, you must add an additional explicit attribute:

<SimpleMapping sqlName="TITLE" multiValue="true" maxNumberOfValues="20"/>


Also, the max number of wildcard values is controlled independently from the total max. In the example above, you have extended the max number of values to 20, but the max number of wildcards within that 20 is still only 5. (This is done to give you more control from a performance perspective.) To adjust the max number of wildcards within the overall max, use the maxNumberOfWildcardValues attribute.

<SimpleMapping sqlName="TITLE" multiValue="true" maxNumberOfValues="20" maxNumberOfWildcardValues="20"/>