EVAL (Macros)
You can write and include macros in your queries. This means you can embed expressions that are parameterized to generate BQL.
You can use macros in expression fields. Select Add Expression Column in Designer.
The macro is executed when the query is constructed, not after the result set has been returned.
EVAL Syntax for Macros
The syntax for macros is:
<EVAL!Expression!>
Example EVAL Syntax for a Designer Column Properties Expression
Macros can be used in conjunction with dashboard prompts, such as with
GETPROMPTVALUE. For example, determine which version of Quantity to use based on a
user-selected prompt answer. If the List prompt brings back “shipped” it shows
[ShippedDate: Sum: Quantity]
; otherwise, it shows [OrderDate:
Sum: Quantity]
.
In Designer, select Add Expression Column.
After the Expression Builder opens, you can specify the expression.
Specify this Expression:
([<EVAL!IIF((GetPromptValue('Requested View','shipped')='ordered'),'OrderDate: ','ShippedDate: ')!>Sum: Quantity])
Go to Column Properties:
Specify the remaining properties, as shown here.: