# Unflatten

new to Analytica 5.0

## Unflatten(x, i, resultIndexes...)

Transforms a one-dimensional vector «x» indexed by «i» into a multidimensional array, indexed by 2 or more «resultIndexes».

«i» is an index of «x», which does not appear in the final result. «resultIndexes» are the dimensions of the final result. The result contains the values of «x» over «i» in the order obtained by varying the first indexes in «resultIndexes» most slowly. Usually, the size of «i» is equal to the product of the sizes of the «resultIndexes». If «i» has fewer elements than that, it pads the remaining cells with Null. If «i» has more elements than needed for the result cells, it ignores the unneeded values along «i».

You may omit Index «i» when unflattening over an implicit index, or over the local index created by a previous call to Flatten or ConcatRows.

## Examples

Unflatten(1..12, resultIndexes: In1, In2) →

## History

Introduced in Analytica 5.0.