Newer Version Available

This content describes an older version of this product. View Latest

Format Measures

You can apply letters or symbols before or after the numeric value, such as for currency, perform decimal rounding, and add grouping and decimal separators.

Formatting a Measure

In this example lens, the values in the Sales column don’t include decimals or currency symbols.

The values table shows the Sales field values without any formatting.
To relabel the Sales field and format its values, modify the XMD as indicated in the bold text.

The field now has the label “Sales (USD)” and its values include a currency symbol and two decimal places.

The values table shows the Sales field with the new label and formatted values.

Formatting a Derived Measure

The following SAQL query contains a derived measure that calculates the average revenue per employee. As shown, the values in this derived field aren’t formatted.

The values table shows the RevPerEmployee derived field values with no formatting.
To relabel the RevPerEmployee field and format its values, modify the XMD as indicated in the bold text.

The field now has the label “Revenue Per Employee” and its values include a currency symbol and a grouping separator.

The values table shows the RevPerEmployee field with the new label and formatted values.

More Formatting Examples

Check out these examples that illustrate how to use symbols to format measures and derived measures.

Goal XMD

Display 500000 as $500,000

(prefix with “$”)

Display 500000 as $500,000

(prefix with “$”, include grouping separator)

Display 500000 as $500,000.00

(prefix with “$”, include grouping separator, apply 2 decimal places)

Display 500000 as –$500,000.00USD

(prefix with “–$”, include grouping separator, apply 2 decimal places, suffix with “USD”)

Display Canadian currency code as a suffix

(include grouping separator, apply 2 decimal places, suffix with “CAD”)

Display -1,234.56 as –$1,234.56

(use a semi-colon delimiter for negatives, pos;neg)

Display -1,234.56 as ($1,234.56)

(Optional. Use a semi-colon delimiter, parenthesis for negatives, pos;(neg)

Display -1,234.56 as $1,234.56-

(Optional. Use a semi-colon delimiter, ‘-’ after the second delimiter, pos;neg;zero)

For more information about using symbols in the customFormat field, see Measures and Derived Measures in XMD.