Datasource Arrays

The DatasourceArray formula allows users to extract rows in a Datasource filtered by date for each model period. This allows users to operate on categorical data, where multiple line items appear per date in a datasource, or to perform custom aggregation on data (for example, if the Datasource data is daily but the model is monthly).

The DatasourceArray formula returns an array with the relevant rows, returning an array with zero rows if no data appears in the selected period.

Note that only numeric columns will be returned, as arrays do not support non-numeric data.

Function Notes
datasourcearray([Datasource Node], 'ColumnName') Basic Syntax of datasourcearray function. Will return an array with default row names (Row 0, Row 1, etc.).
datasourcearray([Datasource Node], 'columns:ColumnName1, ColumnName2') Select multiple columns using a comma separated list. Will return an array with default row names (Row 0, Row 1, etc.).
datasourcearray([Datasource Node], 'columns{;}:ColumnName1; ColumnName2') Specify a custom separator if there are commas in the column names. Will return an array with default row names (Row 0, Row 1, etc.).
datasourcearray([Datasource Node], 'columns:all') Select all (numeric) columns. Will return an array with default row names (Row 0, Row 1, etc.).
datasourcearray([Datasource Node], 'ColumnName', 'RowNameColumn') Specify a column to use for row names.
Note that if the string in the third argument is not a column name, the string will be used as a prefix for the row names (e.g. datasourcearray([Datasource Node], 'ColumnName', 'CustomRowName')) which will result in the following row names:
CustomRowName 0, CustomRowName 1, etc.
datasourcearray([Datasource Node], 'ColumnName', 'RowNameColumn', 'FilterColumn1', 'FilterValue1', 'FilterColumn2', 'FilterValue2', etc.) Filter the returned rows in the same way as other Datasource calls.