9 Replies Latest reply: Mar 25, 2016 12:14 PM by Sunny Talwar

# 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?

• ###### Re: Total of rows in sum instead of avg

Try this:

Sum(Aggr(YourExpression, YourDimensionsFromThePivotTable))

• ###### Re: Total of rows in sum instead of avg

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

After

• ###### Re: Total of rows in sum instead of avg

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

• ###### Re: Total of rows in sum instead of avg

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

Expression:

-     Avg(aantal)

Dimensions:

-      Artikel groep

-      Omschrijving

Collumns

-      Dag

• ###### Re: Total of rows in sum instead of avg

Try this:

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

• ###### Re: Total of rows in sum instead of avg

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

• ###### Re: Total of rows in sum instead of avg

can you post sample app?

• ###### Re: Total of rows in sum instead of avg

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)

)