Cadence Analytics
Cadence Analytics
  • Home
  • Services
  • Clients & Case Studies
  • Portfolio
  • Contact
  • Store
  • More
    • Home
    • Services
    • Clients & Case Studies
    • Portfolio
    • Contact
    • Store
  • Home
  • Services
  • Clients & Case Studies
  • Portfolio
  • Contact
  • Store

SAC Script Examples - Overview & Content

 

Overview

This document is not intended for use as a training guide, it is assumed that readers are familiar with the creation of standard SAC stories & are familiar with the basics of scripting.
 

We will however cover a few of the basics just to aide understanding and help people make a start on their SAC scripting journey.

The document been compiled over time in response to specific SAC development requirements; with that in mind, it does not cover all API’s & functionalities.
 

Planning functionality
As highlighted previously Planning functionality is not covered in this document

Data
Most examples use the Best Run Juice sample dataset, in a couple of examples basic data has been loaded in from excel.




Content


Populating Dropdown Lists & Checkbox Groups

  • Populate a dropdown list with all members of a dimension
  • Adding the ‘All’ value to a dropdown
  • Populate a Dropdown list with only booked dimension members
  • Populate a dropdown list with all dimensions from the data model
  • Populate a dropdown list including specific dimensions from the data model
  • Populate a dropdown list excluding specific dimensions from the data model
  • Populate a dropdown list with all measures from the data model
  • Populate a dropdown list with members of a measure
  • Populate a dropdown list with alphanumerically sorted dimension members
  • Populate a dropdown list with only those members of a dimension present in a table
  • Get the Dimension Filter value applied to a table and set it as the selected key in a dropdown list
  • Populate a Checkbox Group with alphanumerically sorted dimension members
  • Populate a dropdown list with Members of a Dimension from a specific level in a hierarchy
  • Restrict dimension members in a dropdown based on another dimension filter (cascading)


Filtering & Switching Objects in/out of tables & charts

  • Basic Dropdown onSelect code to filter by selected Dimension member or All values
  • Apply a dimension filter using a dropdown list without triggering a data source query
  • Apply a Filter with a single hardcoded dimension member value
  • Apply a Filter with multiple hardcoded dimension member values
  • Filter using exclusion (all values are returned except those specified)
  • Handling undefined values in a dropdown
  • Conditionally filter a table based on measure values
  • Apply a filter using resultset values
  • Filter a table using a search string entered in an Input Field
  • Mutually Exclusive Dropdown Lists

                       Page onInitialization script
                      Dropdown_1 code
                      Dropdown_2 Code

  • Switching Measures in/out of a table using a dropdown list
  • Switch measures in a chart using a dropdown list
  • Switching Dimensions in/out of a table on specific rows
  • Filter a Chart or Table using a Check Box Group
  • Filter to show the first row in a table
  • Use the first & last result / row value from a table as a filter


Retrieving Values from Tables & Charts

  • Retrieve Selected Single Measure value from a table
  • Retrieve a Dimension Member Description from a table
  • Display the selected Dimension Member or Measure value in a text box
  • Write all measure values from a table to the browser console
  • Count dimension members in a chart and write the count to a text box
  • Take a measure value from a numeric point chart and dynamically write it to a text box
  • Take a measure description or full name from a chart and write it to a text box
  • Write Single Dimension Filter value to a text box


Sorting & Ranking Charts

  • Sort a chart by measure values
  • Rank a chart by measure values
  • Rank a chart using values entered via an InputField
  • Apply a Top & Bottom rank in the same chart


Formatting & Display (numeric, hierarchies, member display mode)

  • Set all dimension members in a table to display the member description
  • Set all members in a table to description display mode (safe to use in a table 
  • OnResultChanged event)
  • Flatten the hierarchy of all dimensions present in a table
  • Compact table rows
  • Drill up & down a hierarchy in a table using buttons
  • Format a numeric point chart (primary & secondary values)
  • Format all numeric values in a table
  • Remove numeric format from all values in a table


Loops, If Else, For If

  • Stop a loop when a specific condition is met
  • Nested Else If Condition basic example


Text boxes (miscellaneous)

  • Write the current date to a text box
  • Apply text with carriage return
  • Write dimension descriptions to a text box – one per line
  • Write the model name to a text box


URLs

  • Open the SAC tenant home page in the same tab
  • Open another SAC story in the current browser tab
  • Open another SAC story in a new browser tab
  • Relaunch a SAC story in embed mode in the current browser tab
  • Open a story in embed mode in the same browser tab with the page bar menu hidden


CSS & Animation UX/UI

  • Panels
  • Panel Shadow
  • Panel Border
  • Panel Opacity CSS Classes
  • Panel fade effect
  • Fade a panel into view
  • Fade a panel out of view
  • Panel expand effect
    Top down
    Left to Right
  • Dynamic formatting of buttons
  • Dynamic Relative positioning


Data source refreshing & pausing

  • Refresh Pause Modes
  • Enable / Disable refresh using buttons

Copyright © 2025 Cadence Analytics - All Rights Reserved.