You can concatenate report expression syntax with other JavaScript expressions to customize the content of labels, facts, and dimensions.
For example, if you wanted a group header to show a union of the Total label and the amount, you could insert a field in the Expression line to concatenate Total with the table fact syntax.
Or, you could insert a field to show the sum (or any other data function) of the column divided by the sum of the parent level expressed as a percentage.
If you plan to use this feature, add the labels in a computed field. For information on how to add a computed field, see “Adding Computed Items” on page 5‑34.
In a Report section, you often concatenate some text with a value. For example, you might want to see “Total Sales: $1,234.56” in a group footer instead of just the number. However, since you have concatenated text to the beginning of the number, you cannot set the number format in the traditional way (by using the Properties dialog box). Since you have a concatenated object, you need to set the number format using JavaScript. |
To set a number format on a concatenated item, use the following syntax:
Format(number, mask)
where number is the value to format and mask is the number format mask to apply. Using the example above, your completed expression would be displayed as follows:
“Total Sales: “+ Format(Tables(“Results”).Columns(“Sales”).Sum(currBreak), “$#,##0.00”)