# IndexRangeLoop

Loop extracting a range of input iterations.

This function specifies that the output map element associated with the loop expression tab is to loop corresponding to the value of the input map element argument expression and selecting only iterations of the loop that fall between the start and end index values, and before the end condition is met.

This is useful in the processing of something like the X12 EDI HL loop where it is desirable to process only a range of iterations from the input, and to allow this range to terminate with a certain condition.

If no sort keys are specified, the order of the output is the same order as the input elements.

This function can only be used in the Loop tab.

## Related examples

* [Filtering loop elements on their index](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/8.0/filtering-loop-elements-on-their-index)

## Arguments

| Input Map Element | Add a looping<br>element from the input structure. |
| --- | --- |
| Start Index | Specify the index of the first iteration to include in the output. If<br>it is not specified, all iterations before the end index are<br>returned. |
| End Index | Specify the index of the last iteration to include in the output. If<br>it is not specified, all iterations after the start index are<br>returned. |
| End Condition | Specify an expression that, when true, indicates the looping should<br>stop. |
| Filter | Specify an expression that returns a Boolean.<br>This expression is evaluated for each instance of the loop. If this<br>filter expression returns true, the instance is included in the loop. If it<br>returns false,<br>the instance is excluded from the loop. |
| Sort Keys | Use the AscendingSort or<br>DescendingSort function to sort loop<br>iterations. You can use as many as needed. |
| Contexts | Specify the context using the EnclosingContext or NestedContext function. EnclosingContext specifies the<br>output map element that encloses this loop. If not specified, the<br>nearest looping ancestor map element is used. |