[]
Returns a value on the specified position from the list
Syntax
Choose(index
, Value1
[, Value2
,...[, ValueN
]])
Arguments
index
- the one-based position of the value you want to returnValue1
, ValueN
- the list to return a value fromExamples
You can use the following expression to return the report header based on the DataToDisplay
parameter value.
Choose(@DataToDisplay, "Current Year", "Actual-Prior Year")
Returns one of two values depending on whether the expression is true or not.
Syntax
Choose(expression
, trueReturn
, falseReturn
)
Arguments
expression
- an expression that should evaluate to a boolean valuetrueReturn
- the value to return if the expression evaluates to truefalseReturn
- the value to return if the expression evaluates to falseExamples
You can use the following expression to return the color of text based on the SalesAmount
field value.
{IIF(SalesAmount >= 1000, "Green", "Red")}
Returns the value associated with the first expression in a series that evaluates to true
Syntax
Switch(Expression1
, Value1
[, Expression2
, Value2
,...[, ExpressionN
, ValueN
]])
Arguments
Expression1
...ExpressionN
- expressions that should evaluate to a boolean valueValue1
...ValueN
- values associated with expressionsExamples
You can use the following expression to return the sales channel name based on the ChannelKey
field value.
{Switch(ChannelKey = 1, "Store", ChannelKey = 2, "Online", ChannelKey = 3, "Catalog", ChannelKey = 4, "Reseller")}
Submit and View Feedback For