Error: The Metric object 'xxxx' is defined in terms of itself
STEPS TO REPRODUCE:Follow the steps below to reproduce the issue in the Strategy Tutorial project. In this example, a subtotal is applied on the Revenue metric:
- Create a report with Region on the row and Revenue on the column.
- Add a grand total to report by selecting Data -> Grand Totals. Save and close the report.
- Create a subtotal which calculates (Total Revenue/ Number of Regions). The subtotal has the following definition:
(Sum(Revenue) {@} / Count(Revenue) {@} )
- Save the custom subtotal as 'total/ count'.
- Edit Revenue and go to the 'Subtotals and Aggregation' tab and add the custom subtotal under 'Available subtotals for the metric'. Save and close the metric editor.
- Edit the report created in Step 2.
- In the report, go to Data -> Subtotals and select the 'total/count' subtotal to be displayed.
- Execute the report. The error described above occurs.
CAUSE:
This error occurs due to an incorrect definition of the custom subtotal used in the report.
ACTION:
In order to use the custom subtotal in the report, the user needs to correct the definition of the custom subtotal. For the above case, the user needs to change the custom subtotal definition to the following:
Sum(x) / Count(x)
Now the report returns the expected results, as shown below: