Scripting Patterns and Examples

When you start writing scripts in analytics designer, it might be helpful for you to see and go through typical use cases and examples for scripting in analytic applications. You can then adjust the scripts according to your business needs.

Here you find typical scripting patterns and examples to help you script with analytics designer Table Title
Name Use Case More Information
Version Management APIs on Data Models in SAC: deleteVersion API API to delete a public or private planning version Using the deleteVersion API
Version Management APIs on Data Models in SAC: publish public versions API API to publish public planning versions Using the publish API for Public Planning Versions
Version Management APIs on Data Models in SAC: publish private versions API API to publish private planning versions Using the publish API for Private Planning Versions
Version Management APIs on Data Models in SAC: revert API API to revert planning versions Using the revert API
Version Management APIs on Data Models in SAC: publishAs Public version API API to publish a planning version as a public version Using the publishAs Public Version API
Version Management APIs on Data Models in SAC: copy API API to copy planning versions Using the copy API
Version Management APIs on Data Models in SAC: getOwnerId API API to check if a private planning version is owned by the current user of the private version Using the getOwnerId API
Version Management on SAP BPC Models Version Management APIs for SAP Business Planning Consolidaton models Use Version Management APIs on SAP BPC Models
Calendar Task APIs API to change status and properties of a calendar task Use Calendar Task APIs
Possible Error Messages How to prevent error messages when using APIs Possible Error Messages in the Context of Version Management APIs
setUserInput and submitData API These APIs enable the application user to change the value of a cell in a table at runtime Use the Planning APIs setUserInput and submitData
Data Locking APIs Check if a model is data-locking enabled and set or get data locks Use Data Locking APIs
Formatting APIs Allows end users to format certain values in an application Use Formatting APIs to Format Numbers and Dates
Refresh Data API Allows end users to trigger a data refresh Use Refresh Data API
Pause Refresh Options and APIs Configurate data refresh and interaction settings via script APIs or the Builder panel Use Pause Refresh Options and APIs
Navigation APIs Allows end users to navigate through analytic applications Use Navigate APIs
Layout APIs Set widget size and position dynamically to the application Use Layout APIs
Selection APIs for Tables and Charts Retrieve the currently selected members and their dimensions Use Selection API for Tables and Charts
Result Set APIs Get a result set based on an input data selection in a table or chart Use Result Set APIs
Range and Exclude Filters Allows to range and exclude filters Use Range and Exclude Filters
getVariableValues API Returns an array of the current values of a specified variable Use getVariablevalues API
getDimensionFilters APIs Returns an array of the current values of a specified dimension Use getDimensionFilters API
openSelectModelDialog and setModel API Changes the table's model at runtime by either calling the selection dialog for models or directly with a valid model id Use the openSelectModelDialog and setModel APIs
NULL Members and Totals Memebrs NULL Memebrs as well as Total Memebrs are supported in scripting APIs NULL Members and Totals Members in Scripting APIs
sendNotification API Sends notifications to application users Use sendNotification API
Example 1: OData Actions in an Application Execute OData actions exposed by a connected on-premise system Example 1: Use OData Actions in an Application
Example 2: OData Actions in an Application Display back-end system's response in an application Example 2: Using OData Actions in an Application

Best practices

Here you find typical use cases for creating analytic applications and setting up the interaction among widgets through scripting:

Table Title
Use Case More Information
Switch between a chart and a table by using a toggle feature Best Practice: Switch between Chart and Table
Filter a table or a chart by using a single measure selected from a drop down widget Best Practice: Filter Table and Chart through Dropdown (Single Selection)
Filter a table or a chart by using multiple measures selected from a checkbox group widget Best Practice: Filter Table and Chart through Checkboxes (Multi Selection)
Filter a table, a Chart or an R Visualization by using a Filter Line widget Best Practice: Use Filter Line for Filtering Table, Chart and R Visualization
Filter dimensions and display data according to hierarchies Best Practice: Filter Table and Chart through Cascaded Filtering
Control which measures and diemsions are displayed in tables Best Practice: Add and Remove Dimensions in Tables
How to filter a table or a chart by using popup window Best Practice: Filter Table and Chart through Settings Panel (Popup Window)
Create and open a popup window that contains extra information about the selected element Best Practice: Selection Handling in Table and Chart and Open a Details Popup