Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
rrodriguesrr82
Contributor III
Contributor III

Aggregation level question

Hi folks,

I have the following scenario:

ProductUnitsNTS
Product A101000
Product B10500

  • NTS is calculated by the following Formula: Unit Price * Units (There is table for product price in the model)
  • Consider that Product A and B have different Unit Prices.

I want to achieve the following result table:

ProductUnitsNTS
Product201500

I the table above, I have another dimension level that group Products by Brand. In my example, the brand name is Product.

However, by considering the NTS is not pre-calculated, I mean, NTS is actually an expression that multiplies Unit Price by Units, I'm getting the following NTS value:

  • Unit Price for Product A: 100;
  • Unit Price for Product B: 50;
  • Current Result: 20 * 150 = 3000.

I have tried to use AGGR, but I'm not so familiar with this function.

Do you have some clue?

Best,

Rubens

2 Replies
Anonymous
Not applicable

Hello!

Try this:

=Sum(TOTAL AGGR(Sum([Unit Price]*Units), Product))

sunny_talwar

or you can just use this

=Sum(Aggr(Sum(Unit Price * Units), Brand, Product))