VAR Function
Summary
- The
VARfunction in AdaptableQL enables developers to supply bespoke, custom values - These can then be referenced, and evaluated, in other Expressions
The VAR Expression Function allows developers to provide custom values which can be used in Expressions.
The return value of the VAR can be either
- a 'hard-coded' value (string, number, boolean or Date)
- a function that returns a value
The VAR values are provided at design-time via the customQueryVariables property in Expression Options.
customQueryVariables
Default: nullRecord<string, [return_value]>Custom variables to be used in AdapTableQL
AdapTableQL: VAR Expression Function
- This Example demonstrates how to use the
VARExpression Function - In Expression Options we define 3
VARExpressions (all of which are then used in Adaptable Objects):EMISSION_DATE- has a hard-coded value of 1 Jan 2014 - and then used in a Format Column ConditionVAT- a function that returns a number based on the Country param it receives - used to create theFull PriceCalculated ColumnBEST_SELLER- has a mock server returned value of "Corolla" - and then used in a Format Column Condition and a Data Change Alert
- We have also created a Named Query called 'Good Performance' which uses the first 2 VAR Expressions
Expand to see how the VAR Expression Functions are Used
Try It Out
- Change the Price for "Corolla" and note the Alert that fires
- Select and run the "Good Performance" Query from the Grid Filter Toolbar and see both VAR Expressions be used