Excel Merge Template Functions
| Function | Description | Syntax | Parameters | Example |
|---|---|---|---|---|
| If | A conditional statement. When condition is true, the IfTrue expression is evaluated; otherwise, the IfFalse expression is. | <#if(Condition; IfTrue; IfFalse)> | NA | <if(<#value>=1;One;Not One)> writes “One” if the report variable “Value” is 1, and “Not One” if not. |
| List | Returns a string with all values from a table one after the other, separated by a delimiter. If the table has only one record, use <#List(table.field)> to get the value of the only record without having to define any __table__ named range. | <#List(dataset name and column)>
or <#List(dataset name; list separator; agg expression; filter)> |
|
|
| Lookup | Searches for a field description on another table. | <#lookup(table name; search key names; search key values ;result field)> |
|
If you keep a CustomerId on an Orders table
and the Customer data on a Customers table, you can use the following to output
the real customer name for an order:
<#lookup(Customers;CustomerId;<#Orders.CustomerId>;CustomerName)> |
| Switch | Compares SwitchValue against value1, value2, etc., in order. If SwitchValue is equal to any of the value_n, then result_n is returned. You can provide a default value as the last parameter. If no value matches SwitchValue, and you have a default parameter, then the default is returned. The default is inferred from the number of arguments: An odd number of arguments (3, 5, 7...) don't have a default value. If the number of arguments is even, then the last parameter is the default. | <#switch(SwitchValue; value1; result1; value2; result2...[default])> | NA |
|