Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Total of rows in sum instead of avg

Hi all,


I created a pivot chart using avg sales per product.

Our products are summarized in categories.

Now I need to have a sum of the total avg per category instead of the avg per category.

is this posible?

Thanks in advance

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(Aggr(YourExpression, YourDimensionsFromThePivotTable))

View solution in original post

9 Replies
sunny_talwar

Try this:

Sum(Aggr(YourExpression, YourDimensionsFromThePivotTable))

raajaswin
Creator III
Creator III

can you post sample app?

Not applicable
Author

Example.PNG

swuehl
MVP
MVP

Not sure if I fully understand.

It would be helpful if you could explain your setting with some sample lines of data and expected result.

You may also need to check for expression evaluation per Dimensionality() or SecondaryDimensionality() (for horizontal dimensions) depending on your need to use different aggregations on different aggregation levels, like

=If(Dimensionality() = 0,

Sum( Aggr( Avg(Sales), Category, Product)), // or maybe Sum( Aggr( Avg(Sales), Category)) ?

Avg(Sales)

)

Not applicable
Author

Hi Sunny,

The formula worked for the totals

But now the data of my columns doesn’t are changed.

Can you help me with that?

Before

DATA before.PNG

After

DATA After.PNG

sunny_talwar

What all dimensions do you have? and what expression did you use?

swuehl
MVP
MVP

Maybe you forgot to add the Weekday dimension (omschriving?) to the aggr() dimension list?

Not applicable
Author

Sum(Aggr(Avg(Aantal),Omschrijving))

Expression:

-     Avg(aantal)

Dimensions:

-      Artikel groep

-      Omschrijving

Collumns

-      Dag

sunny_talwar

Try this:

Sum(Aggr(Avg(Aantal),Omschrijving, [Artikel groep]))