match - script and chart function
The match function compares the first parameter with all the following ones and returns the numeric location of the expressions that match. The comparison is case sensitive.
Syntax:
match( str, expr1 [ , expr2,...exprN ])
Return data type: integer
Tip noteIf you want to use case insensitive comparison, use the mixmatch function. If you want to use case insensitive comparison and wildcards, use the wildmatch function.
Argument | Description |
---|---|
str | The string to be evaluated. |
expr1 | The first expression to check for a valid number representation. |
expr2 |
The second expression to check for a valid number representation. |
expr3 |
The third expression to check for a valid number representation. |
Example | Result |
---|---|
match( ColorCode,'Blue','Black' ) |
This expression returns the index of the match to the ColorCode field. If the value of ColorCode is Blue then it returns 1. If the value of ColorCode is Black then it returns 2. If no match is found then 0 is returned. |
match( Region, 'North', 'East' ) | This expression returns the index of the match to the Region field. If the value of Region is North then it returns 1. If the value of Region is East then it returns 2. If no match is found then 0 is returned. |
Some of the examples in this topic use inline loads. For more information, see Using inline loads to load data.