Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of averages in a straight table

Hi,

I have a straight table whith a expression avg().

06-02-2015 14-24-23.png

The values in "Ambar", "Esmeralda",...etc are the values of a dimension , they are average values this is right.

The values "Punta Cana", "Riviera Maya" and "Samaná"  are values of another dimension, they are also average values, but I would like they where sum values so "Punta Cana" = 2904 instead of 968 , etc.

How could I get a sum of averages instead of an average of averages whitout losing this format?

Thanks

1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

6 Replies
giakoum
Partner - Master II
Partner - Master II

try sum(total <dimension1> aggr(avg(value), dimension2)) or similar

sample application would help

rubenmarin

Hi Luis, you can use:

If(Dimensionality()=1, Sum(Aggr(Avg(ValueFieldName), Dimension2FieldName)),

Avg(ValueFieldName))

Not tested, maybe is:

If(Dimensionality()=1, Sum(Aggr(Avg(ValueFieldName), Dimension1FieldName, Dimension2FieldName)),

Avg(ValueFieldName))

Anonymous
Not applicable
Author

Hello,

Try something like:

sum(aggr(avg(Exp),Dim1,Dim2)

Aggr should solve that somehow.

BR

Serhan

laujerry
Creator
Creator

for straight table

in expressions -> total mode

choose "Sum of rows"

Not applicable
Author

I' m sorry it is not a straight table but a pivot table.

I have attached a sample and I would like that the totals were 106 , 82 and 94 instead of 53, 41 and 47.

Thanks

giakoum
Partner - Master II
Partner - Master II

see attached