Skip to main content Skip to complementary content

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.
Arguments
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: Chart expressions
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.

Example - Categorize products using match

Example - Evaluate and classify client data using match

Example: Load script using match

Example - Chart expression using match

Example - Custom sort expression using match

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!