endswith_ci(X;L)

Returns a boolean value indicating whether a given string ends with any of the substrings in a given list and is case insensitive. (Available as of version 12.33)

Syntax

endswith_ci(X;L)

Input

Argument Type Description
X text The string to search for in the items in the list L

A scalar value or the name of a column

L text A space- or comma-separated list of text strings against which to compare X

Return Value

Returns an integer value of 1 if X ends with any of the strings in the list L. Otherwise, returns 0.

If X is N/A, the result is 0.

Sample Usage

value list endswith_ci(value;list)
'banana' 'ABC' 'ana' 'yz' 1
'banana' 'ABC' 'yz' 0

Example

In the "Sales Item Detail" table (pub.demo.retail.item), you can find only those rows whose SKUs end with either "6" or "9". To do this, create a computed column and apply the endswith_ci(X;L) function to the sku column, where L is the list containing the strings '6' and '9'.

<base table="pub.demo.retail.item"/>
<willbe name="example" value="endswith_ci(sku;'6' '9')"/>

For those values in the sku column that end with "6" or "9", the result is 1.

Otherwise, the result is 0.

You could then use the <sel> operation to select only those rows where the example column equals 1.

<sel value="(example=1)"/>

The results are those rows where the value in the sku column is 366, 969, or A96.

Additional Information

endswith_ci(X;L) is identical to endswith(X;L) except that it performs case-insensitive (in the English alphabet) comparisons.