Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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
MVP
MVP

Re: Total of rows in sum instead of avg

Try this:

Sum(Aggr(YourExpression, YourDimensionsFromThePivotTable))

9 Replies
MVP
MVP

Re: Total of rows in sum instead of avg

Try this:

Sum(Aggr(YourExpression, YourDimensionsFromThePivotTable))

raajaswin
Contributor III

Re: Total of rows in sum instead of avg

can you post sample app?

Not applicable

Re: Total of rows in sum instead of avg

Example.PNG

MVP
MVP

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)

)

Not applicable

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

DATA before.PNG

After

DATA After.PNG

MVP
MVP

Re: Total of rows in sum instead of avg

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

MVP
MVP

Re: Total of rows in sum instead of avg

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

Not applicable

Re: Total of rows in sum instead of avg

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

Expression:

-     Avg(aantal)

Dimensions:

-      Artikel groep

-      Omschrijving

Collumns

-      Dag

MVP
MVP

Re: Total of rows in sum instead of avg

Try this:

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