Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

INDEXOF

INDEXOF

Finds the index of a value among a list of values. By default, the match is case sensitive.

Syntax

INDEXOF(
valueToSearch, string1
, [
string2
, ...,
stringN
,]
CaseFlag
)
Argument
Required/
Optional
Description
valueToSearch
Required
String datatype. Value you want to search for in the list of strings.
string
Required
String datatype. Comma-separated list of values you want to search against. Values can be in string format. There is no maximum number of values you can list. The value is case sensitive, unless you set MatchCase to 0.
CaseFlag
Required
Must be an integer. Determines whether the arguments in this function are case sensitive. You can enter any valid expression.
When
CaseFlag
is a number other than 0, the function is case sensitive.
When
CaseFlag
is a null value or 0, the function is not case sensitive.

Return Value

1 if the input value matches
string1
, 2 if the input value matches
string2
, and so on.
0 if the input value is not found.
NULL if the input is a null value.

Example

The following expression determines if values from the ITEM_NAME column match the first, second, or third string:
INDEXOF( ITEM_NAME, ‘diving hood’, ‘flashlight’, ‘safety knife’)
ITEM_NAME
RETURN VALUE
Safety Knife
0
diving hood
1
Compass
0
safety knife
3
flashlight
2
Safety Knife returns a value of 0 because it does not match the case of the input value.

0 COMMENTS

We’d like to hear from you!