Cross-Widget Interactivity and Dynamic Filtering with Scripting APIs (Part 6)
Preview · a free account unlocks the full lesson
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 sectionsHide sections
Visual overview
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.
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.