# ArraySlice

The **ArraySlice** function returns a portion of an array, defined by the starting index and length.

### Syntax

`ArraySlice(array, start, length)`

The **ArraySlice** function has the following arguments.

In general, if any of the arguments used by the function is `Null`, it returns `Null`.

|            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| array      | <p><br>Required. The input array that Sigma parses to extract a portion as a new array. Must be an array structure; to create single array from a column, use the <a data-mention href="../aggregate-functions/arrayagg">arrayagg</a> function. If this value is <code>Null</code>, then Analytics Pro does not return an array; see Example. If the array is empty, Analytics Pro returns an empty array; see Example.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **array2** | <p><br>Required. The beginning, or the starting index for extracting the new array from the original array. The range of valid valued are from <code>0</code> to <code>ArrayLength(array) - 1</code>. If the value calculates beyond the end of the original array, Analytics Pro returns an empty array, represented as <code>\[]</code>. Negative values count from the end of the array, so <code>-2</code> is the second from the last position in the original array. If this value is negative and the index calculates beyond the beginning of the original array, then the value defaults to <code>0</code>. If this value is negative and Analytics Pro applies a <code>Null</code> value, it does not return an array;  column <em><strong>ArraySlice(array, start, length)</strong></em>. If both and are <code>Null</code>, the function does not return an array; it evaluates to <code>Null</code>. Analytics Pro rounds floating numbers to the nearest integer; see Example, where the applied start is <code>3</code>.</p> |
| length     | <p><br>Optional. The length of the new array. If there is no value (<code>Null</code>) and Analytics Pro applies it, then it does not return an array; see Example, column <em><strong>ArraySlice(array, start, length)</strong></em> If the value is so large that the ending index calculates beyond the size of the original array, the function extracts from the start index to the end of the original array. See Example. If this value is negative, the function returns an empty array; see Example. If both and are <code>Null</code>, the function does not return an array; it evaluates to <code>Null</code>. See Example. Analytics Pro rounds floating numbers to the nearest integer; see Example, where the applied length is <code>3</code>.</p>                                                                                                                                                                                                                                                                          |

### Examples

The following examples of **ArraySlice** function demonstrate how this function works.

<figure><img src="https://files.readme.io/38dec82-image.png" alt=""><figcaption></figcaption></figure>

<br>
