Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference INDEX
Functions and Expressions Reference Guide
127
INDEX
The INDEX function returns an integer that represents the index of an object
relative to its nearest contained object, counting only valid objects.
Syntax
INDEX (single-object-name)
Meaning
INDEX (object_for_which_to_get_index)
Returns
This function returns a single-integer.
The result is the index of object_for_which_to_get_index.
! If object_for_which_to_get_index is an input, this will be the index within
all valid objects.
! If object_for_which_to_get_index is an output, this will be the index within
all objects (valid and invalid).
Returns 0 if the input argument is NONE.
Note The difference between INDEXABS and INDEX is that INDEXABS counts both
valid and invalid instances, whereas INDEX counts only valid instances.
Examples
Message (s) = IF (INDEX (Message:Input) > 3, Message:Input,
NONE)
For example, there are five Messages in Input. The first three evaluations of
this rule return NONE. The fourth evaluation returns Message[4]. The fifth
evaluation returns Message[5].
Invoice (s) = MyMap (Invoice Segment:Input, INDEX ($))
For the first evaluation of MyMap, INDEX($) is 1. For the second evaluation of
MyMap,
INDEX($) is 2.