Learn How Script APIs Work on Different Model Types

Learn about how script APIs work on different types of models as SAP Analytics Cloud models can now have both account and measure structures.

In the following table you can find how different script APIs affect structure or structure members in different types of models:
API Models with Accounts Only Models with Measures Only (including new models without accounts) Models with Both Measures and Accounts
Alias.MeasureDimension resolves to: accounts measures measures
DataSource.getMeasures returns: accounts measures measures
Chart.getMeasures, Chart.addMeasure and Chart.removeMeasure (deprecated) operate on: accounts measures accounts
Chart.getMembers, Chart.addMember and Chart.removeMember (new) operate on: accounts measures accounts
DataSource.getDimensions returns: all dimensions, including account dimension all dimensions, including measure dimension all dimensions, including account and measure dimensions
Table.getSelections and Chart.getSelections can contain: Alias.MeasureDimension (for accounts) Alias.MeasureDimension (for measures) Alias.MeasureDimension
Note

There won't be a DataSource.getAccounts function, as you can always get the account members by using getMembers on the account structure.

Chart.getMeasures, Chart.addMeasure and Chart.removeMeasure have been deprecated. Their name might be misleading, as for models with both measures and accounts, the APIs will operate on the accounts.