With SAP focusing on cloud-based analytics, SAP Analytics Cloud (SAC) is becoming one of the most sort after tools in the SAP BI Space. SAC is more of a self-service solution on the cloud, hence, there was a constant business need for a professionally authored dash-boarding tool on the cloud. SAP now has a solution for this in the form of Analytics Designer.
Analytics Designer has many features that makes it very interactive. For this purpose, it uses, tables, charts, various widgets and script logic to bind all these together.
In this blog, we will see the use of script logic for enabling the checkbox feature in Analytics Designer. We will be using the checkbox to select the account dimension member and the table output will change dynamically as per the selection.
- Create a new Analytic Designer Application.
- Add the below objects in the canvas
Mandatory Widgets:
A. Table:
Rows – Any Dimension
Column – Account (Filtered on a member)
B. Buttons:
- Set Measure
- Remove Measure
- Set All Measures
C. Checkbox Group
Once the structure is ready, we can include the script logic.
- Create two script variables of type String and set as array. It will be required to capture and store the checkbox selections.
- Create a Class and function (Argument: String[set as array], Return Type: Void) in the script objects panel
- Add the below logic in the script function to modify the table dimension as per the checkbox selection.
Note: Replace the function argument as per the dimension name of the model.
- Go to edit script on the canvas and include the below logic in ‘onInitialization’ function to retrieve the Account Dimension Members of the model:
Note: Replace the table name as per the configuration
- Edit the scripts of the buttons to execute the Checkbox functionality.
- Button – Set All Measures
- Button – Remove All Measures
- Button – Set Measure Filter
To run the application, save it and click on Run Analytic Application Button.
Output: Table Dimension will change as per the Checkbox selection.