- IIF(<expression>, <value if true>, <value if false>)
The function name may need to be prefixed with an equals sign depending on the element and attribute.
In a Label element's Caption attribute
For example, as shown above,
- =IIF(@Data.Color~ = 1, 'Red', 'Green')
will display the appropriate text, Red or Green, in the Label based on the data value.
The IIF function can be used in combination with other intrinsic string functions in an expression to generate the correct value.
If used in the Calculated Column element's Formula attribute, as shown above, the IIF function can be used to generate a new column that replaces part of a SQL time string with the Eastern Daylight Time or Eastern Standard Time acronym (EDT or EST): IIF(Right("@Data.CurrentDateTime~",6) = "-04:00", "EDT", "EST")