Overview
In Astrato, variables and parameters work together to make analytics dynamic and context-aware.
Variable = the value that can change during a user session
Parameter = the placeholder that receives that value inside the semantic model / SQL
Think of a parameter as the socket and the variable as the plug.
Variables
Variables drive interactivity across the workbook. Variable can also be nested inside other variables usinf $() notation, Dashboard: $(vCurrentSheet).
They store values that can be:
selected by a user
set by an action
controlled by embedding context
written back to a database
set to trigger actions on value update
What they control
| Typical use cases
|
Parameters
Parameters are "placeholders" that receive a value when the paramter is used, they can utilize a default value, a custom value, or a value linked to a variable. Parameters are available in custom SQL and in measures created in the Semantic Layer.
Measure Parameters
SQL Parameters (and why they matter in Astrato)
Using parameters in SQL gives you control, speed, and safety. Parameters turn SQL from fixed code into a flexible engine that users can control.
Here are the real, practical wins:
One query, many uses
Example:
| Faster to build and maintain
Less code = fewer bugs and less upkeep.
| Better performance That means:
|
How they work together
Variable gets a value in the workbook
Variable is mapped to a parameter
Parameter injects the value into the semantic model query
If a parameter is not mapped, its default value is used.
Naming best practice
Use identical names for variables and parameters.
Why:
Avoid manual mapping
Prevent falling back to default parameter values
Faster model setup
Lower risk of deployment mistakes
If names differ → manual mapping is required (works fine, easier to forget).
