Investment Studio > Expressions > Functions > Matrix > SWAPROWS

array[m][n] swaprows(array[m][n] table, integer column_1, integer column_2)

Returns the two-dimensional table array with rows number column_1 and column_2 interchanged.

Example

=swaprows({{1, 2}, {3, 4}, {5, 6}}, 1, 3)

returns {{5, 6}, {3, 4}, {1, 2}}.

See also flipcols, fliprows, msort, swapcols, transpose.