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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sangeess21
Creator
Creator

Help with Aggr() function

I have an expression using aggr() that I'm struggling with. I'm trying to show Extended Avg Selling Price (Quantity* Avg Selling Price) for CM supplier using a Pivot table. But the total value is not being summed up correctly.


The expression I've used is

if(Match(Dimensionality( ),0,1,2), sum(aggr(sum(Quantity)*[Avg Selling Price],[Purchase Order])), sum(Quantity)*[Avg Selling Price])


I appreciate any help... Thanks!

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Try

SUM(Quantity * [Avg Selling Price])

instead of

sum(Quantity)*[Avg Selling Price])

View solution in original post

3 Replies
MK_QSL
MVP
MVP

Try

SUM(Quantity * [Avg Selling Price])

instead of

sum(Quantity)*[Avg Selling Price])

balabhaskarqlik

May be:

if(Match(Dimensionality( ),0,1,2), sum(aggr(sum(Quantity)*Only([Avg Selling Price]),[Purchase Order])), sum(Quantity)*Only([Avg Selling Price]))

sangeess21
Creator
Creator
Author

Thank you. It's working as expected.