ERPClimb logoERPClimb
Analytics Designer
SAC / Datasphereintermediate 9 min read

Cross-Widget Interactivity and Dynamic Filtering with Scripting APIs (Part 6)

Preview · a free account unlocks the full lesson

Key takeaway

Learn how to wire chart, table, and filter-line widgets together using Analytics Designer scripting so that a click, dropdown change, or input control drives filters and selections across an entire analytic application.

In this lessonShow sections

Visual overview

Cross-Widget Interactivity and Dynamic Filtering with Scripting APIs (Part 6) — learning sheetIn one line: Learn how to wire chart, table, and filter-line widgets together using Analytics Designer scripting so that a click, dropdown change, or input control drives filters and selections across an entire analytic application.ERPClimb.com / SAC / LESSON 6/7 / LEARNING SHEETCross-Widget Interactivity and Dynamic Filtering withScripting APIs (Part 6)1 · IN ONE LINELearn how to wire chart, table, and filter-line widgets together using Analytics Designerscripting so that a click, dropdown change, or input control drives filters and selectionsacross an entire analytic application.2 · KEY IDEAS EXPLAINED1Analytics Designer separates layout (widgetsplaced on the canvas) from behavior (scriptsattached to widget events). The core value of thetool over plain SAC stories is that you can scriptexactly what happens when a user interacts withone widget so that other widgets respond in a…2The foundation is the onClick (or onSelect) eventavailable on chart and table widgets. Inside theevent handler you receive a ResultCellData orSelection object that tells you which member,dimension, and measure the user touched. You thencall setDimensionFilter, setFilter, or…3A second interactivity pattern uses standalonecontrols: Dropdown, InputField, RadioButton, andPopup widgets are not bound to a model directlybut raise onSelect or onChange events. Scriptsread the selected value with getSelectedKey() andapply it via setVariableValue (for prompted…4A third and more advanced but stillintermediate-level pattern is using anApplication-level script variable (a globalvariable defined in the Analytics Designervariables panel, not a model variable) to holdshared state, such as the currently selected KPI…3 · DO · AVOIDBest practice!Common mistakeCentralize cross-widget filter state in aglobal Application-level script variable…Apply all filters needed for one user actionwithin a single script block to avoid…Guard against undefined selections by checkingarray length or null before reading selection…✕Duplicating filter-setting logic in everywidget's event script instead of centralizing…✕Calling getSelectedKey() or reading selectiondata before the widget has finished its…✕Assuming a dimension filter set on onewidget's DataSource automatically applies to…4 · IN A REAL PROJECTA retail FP&A team requested an executive dashboard where clicking a bar in a regional sales chart wouldfilter a detail table, a trend chart, and a KPI card simultaneously, while a separate dropdown let usersoverride the time period independently. The initial build applied filters directly inside each chart's onClick…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Analytics Designer separates layout (widgets placed on the canvas) from behavior (scripts attached to widget events). The core value of the tool over plain SAC stories is that you can script exactly what happens when a user interacts with one widget so that other widgets respond in a controlled, testable way.

This lesson focuses on the intermediate skill of cross-widget interactivity: capturing a user action on one object (a chart bar click, a dropdown selection, an input field change) and propagating that as a filter or selection onto other data-bound widgets.

The foundation is the onClick (or onSelect) event available on chart and table widgets. Inside the event handler you receive a ResultCellData or Selection object that tells you which member, dimension, and measure the user touched. You then call setDimensionFilter, setFilter, or setVariableValue on the target widgets' data sources to push that context forward.

Because each widget in Analytics Designer is bound to its own DataSource object (even when multiple widgets share the same underlying model), filters must generally be applied to each DataSource individually unless you use a shared filter or global application variable to centralize state.

A second interactivity pattern uses standalone controls: Dropdown, InputField, RadioButton, and Popup widgets are not bound to a model directly but raise onSelect or onChange events. Scripts read the selected value with getSelectedKey() and apply it via setVariableValue (for prompted variables) or setDimensionFilter (for straightforward member filters). This lets you build parameter-driven applications, for example a region selector that filters five charts and a table simultaneously, or a scenario switcher for planning versions.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.