Scripting Basics
SAP Analytics Cloud scripting
Provides programmatic control over measures, values, and calculations at runtime.
Using scripting, developers can format numeric outputs precisely, manipulate raw and formatted values, handle nulls and zero-suppression safely, and apply conditional logic based on numeric thresholds or measure results.
This section focuses on common scripting patterns that you will regularly use
Script Examples
-
Sort a table by measure values
-
Get dimension ids in specific rows and write them to a text box
-
Retrieve a measure name and write it to a text box
-
Write the Coefficient of Variation to a text box
-
Write the spread between the highest & lowest value to the text box with dynamic numeric formatting
-
Retrieve the average value from a Resultset and write it to a text box
-
Retrieve the lowest value from a Resultset and write it to a text box
-
Retrieve the highest value from a Resultset and write it to a text box
-
Show / Hide a Table using a single line of script
-
Nested Else If Condition basic example
-
Stop a For IF loop when a specific condition is met
-
Write Single Dimension Filter value to a text box
-
Take a measure description or full name from a chart and write it to a text box
-
Take a measure value from a numeric point chart and dynamically write it to a text box
-
Count dimension members in a chart and write the count to a text box
-
Write all measure values from a table to the browser console
For broader context on SAC scripting concepts, see our SAP Analytics Cloud scripting resources.
