skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : SubSequence
 

Try Corticon Now

SubSequence

SYNTAX

<Sequence> ->subSequence(integer1,integer2)

DESCRIPTION

Returns a Sequence containing all elements of <Sequence> between the positions integer1 and integer2. Another operator, such as ->sortedBy or ->sortedByDesc, must be used to transform a <Collection> into a <Sequence> before ->subSequence may be used. <Sequence> must be expressed as a unique alias. See Advanced Collection Syntax for more examples of usage.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.
Both integer values must be provided, separated by a comma. If integer1 is larger than integer2, there are no results. When integer1 is beyond the count of the collection, there are no results. When integer2 is beyond the count of the collection, all data from integer1 to the last entity is in the results collection. There are no results when both integers extend beyond the number of elements in the collection.

RULESHEET EXAMPLE

This sample Rulesheet uses ->subSequence(3,4) to identify the 'middle' two elements of the sequence that resulted from the sortedBy operation.

SAMPLE RULETEST

A sample Ruletest provides a collection of five elements, each with a decimal1 value. Input and Output panels are shown below.
Note: The selected entities and their values are highlighted to improve readability.