Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rahul8273
Contributor
Contributor

Comparing 2 measures which are at different level of aggregation.

Hi Community,

In one my use case I want to compare the 2 measures which are in different level of aggregation.

For Example

Measure 1 : Avg(Aggr(Sum(Profit)/Sum(Sales), YearMonth, Product))

Measure 2 : Avg(Aggr(Sum(Profit)/Sum(Sales), YearMonth, Product, Country))

Now in my final output viz I will have Product on Rows and Country on Col (in pivot table) and in the values I want to show the difference between the measure1 and measure 2.

It may be straightforward but I am stuck on this.

 

Labels (1)
1 Reply
jbhappysocks
Creator II
Creator II

Hi

Change measure 1 to Avg(total <Product> Aggr(Sum(Profit)/Sum(Sales), YearMonth, Product))

(If you add YearMonth to the pivot it's total <Product, YearMonth>)