Please enable JavaScript to view this site.

The WORDS function returns the number of words in a source data string. This function examines a source data string and determines the number of words, contiguous strings of characters, separated by at least one (1) space, that exist within the string.

Category

String

Syntax

WORDS(data_string)

 

Parameter Descriptions

data_string  The source data string in character format. The data string can be a field from a source datastore, a variable, a constant or the result of another Function.

Example

Examine the contents of source field INPUT_STRING and count the number of words (separated by spaces) in the source field. Assume that INPUT_STRING contains the phrase This is a test for counting words in a string. Map the number of words into target field TGT_WORD_COUNT

TGT_WORD_COUNT = WORDS (INPUT_STRING)

 

Returns the value 10 and maps the result to the target field.