GIST: Reshape Arrays

LAMBDAs for pivoting/unpivoting tables or arrays and creating cartesian products

This module provides LAMBDAs I use to filter, summarize and pivot tabular data by period ranges, as well as unpivot crosstab ranges. I also include the n-Fold Cartesian Product LAMBDA used in multidimensional modeling. Use this URL in the Advanced Formula Environment ad-in to download this module into your models: 

https://gist.github.com/CHatmaker/cc0e8975d30b40734641a06dbae02143 

Aboutλ

About this module and links to online resources

 PvtSumByPrdλ

Summarize a tabular array to a crosstab array summarizing by period.

UnPivotλ

Convert a crosstab array into a tabular array

RemoveZeroValuesλ

Remove zero values from an unpivoted array

  RevHrzArrayλ

Reverse a horizontal array (used in nFoldCartProdλ)

 ProdPriorDimλ

Designed to create the product of prior dimension counts (used in nFoldCartProdλ) but can be used produce the produce of numbers going from left to right.

 nFoldCartProdλ

Creates the n-fold Cartesian Product Index for n dimensions of various lengths