Parameter
Create dynamic notebooks and reports.
Last updated
Was this helpful?
Create dynamic notebooks and reports.
Last updated
Was this helpful?
By using the Parameter defined in Notebooks, you can make Notebooks and Reports dynamic and interactive. This allows you to control embedded SQL through parameters without directly accessing SQL, and obtain tailored outputs as needed.
Make notebooks and reports dynamic:
Make Notebooks and Reports dynamic and interactive.
Choose from various data types and associated input widgets.
Escape and dynamic reference generation:
The escape processing changes according to the context in which the parameter is used in SQL.
Two types of scopes:
Choose parameters used across the notebook or on a page-by-page basis.
Parameter overwrite:
Fine-grained control by overwriting parameters when chaining SQL.
Once you create a parameter, you can embed a reference to it within an SQL block in the notebook by typing /param/{param_name}
.
For example, if you create a parameter named param1
as a string parameter and input the value val1
, the SQL:
SELECT {{param1}}
will be converted to:
SELECT 'val1'
Parameters have two types of scopes:
Notebook common
Parameters shared across all pages in the notebook
Parameter definitions are shared across the notebook, but values are retained on each page
Page specific
Parameters specific to each page
For parameters used in SQL blocks that are referenced from multiple pages, use Notebook common
parameters. Otherwise, use Page specific
parameters.
For example, when a chart created on a document page is referenced on a grid page, the SQL block serving as the chart’s data source should use Notebook common
parameters.
When chaining SQL, you may want to cut off the parameter dependencies. For example:
Setting unique parameters for each page when chaining SQL across pages.
Using different parameters for different SQLs derived from the same base SQL.
Parameters can be overwritten on a popup displayed by hovering over the referenced SQL in SQL Blocks.
Parameter values and execution results in notebooks are synchronized among users. However, using notebook version or reports ensure that changes to parameter values and execution results are not synchronized between users, reflecting changes only to the user who changes the values.
For more details, please refer to the Notebook Version.