Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.

App Development

Announcements
Week 2: Presenting "Automate Sucess" and "Integration for Innovation" - WATCH NOW

Who Me Too'd this topic

retretrt
Contributor II
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)
Who Me Too'd this topic