Announcements
cancel
Showing results for
Did you mean:
Contributor II

## Why is it not possible to sum (or aggregate) various master measures?

I have 3 master measures: Total Sales, Weight and Return. The Total Sales master measure is the sum of Weight*Return master measures. The following are the formulas for each master measure:

Weight (Master measure):  aggr(Sum(WGT_SALES) / Sum({1} total <DATE_TIME> WGT_SALES), COMPANY_NAME, DATE_TIME, INDUSTRY)

Return (Master measure): aggr((({1}SALES) / ({1}SALES_previous_day)) - 1, COMPANY_NAME, DATE_TIME, INDUSTRY)

Total Sales (Master measure): Weight*Return

In the formula editor I type the formula:

sum ({1} total <DATE_TIME> Total Sales)

, which I want to display as a column in a table. However, when using an aggregator like Sum (or Max, Min, Avg etc.) I get an error in the expression. In the formula editor it just turns "black" (as in not active/cant be read by the editor), and not purple-colored which is the default color for master measure fields.

If write out the entire formula without using master measures, it works fine. The "written out" formula would look like this:

sum ({1} total <DATE_TIME> aggr(Sum(WGT_SALES) / Sum({1} total <DATE_TIME> WGT_SALES), COMPANY_NAME, DATE_TIME, INDUSTRY) * aggr((({1}SALES) / ({1}SALES_previous_day)) - 1, COMPANY_NAME, DATE_TIME)

Why is it not possible or an error to sum (or aggregate) various master measures?

Labels (1)
• ### General Question

2 Replies
Creator

Hello @retretrt ,

If it doesn't work that means it's not possible to do that (currently).

According to my knowledge, you can reuse the master items measures to perform some basic calculations like addition or division. Encapsulate your master item measure in an aggregate function doesn't work unfortunately.

Regards.