Custom Measures versus Custom Report Expressions

When do you use a custom measure versus using a custom report expression? They use different means of computing the data.

Custom Measures

A custom measure is a new measure you create from fields in the underlying database, using a special formula syntax in the Admin - Customize Space - Custom Measures tab.  When you add a custom measure, Designer and Visualizer list it in their Default Subject Areas.

For example, a custom measure called Revenue Formula shows total revenue using this formula:

[Quantity]*[Unit Price]

Birst multiplies each unit price with its corresponding quantity and then sums it.

See Formula Reference for Custom Attributes and Measures.

Report Expressions

Custom report expressions are expressions that are presented to the user on-the-fly in a report. They use measures from a subject area. The aggregation is included in the definition of a measure to be used on a report.

For example:

[Sales Date: Sum: Quantity]*[Sales Date: Avg: Unit Price]

OBIEE Conversion Tool - Managing Derived Expressions

For those spaces leveraging the OBIEE conversion tool, derived expressions are now exposed in the (Birst Admin> Customize Space> Derived Expressions) for management and debugging purposes.

Differences Between a Custom Measure and a Report Expression

Compared to the custom measure that calculates from the database fields, the report expression gives a different result because it first computes the aggregations. For example, it computes the sum of Quantity and then multiplies that with the average Unit Price for all units.

It is very important to be aware of this difference if you want accurate data.

The example below divides the revenue into product categories and the result differs from the custom measure approach.

For this example, the first approach would be the most correct, but the approach you take may vary depending on what you are trying to communicate.

See Also
Creating Custom Measures
Defining Expressions in Designer
Adding an Expression in Visualizer Expression Builder
Pre-Aggregation vs. Post-Aggregation Calculations