Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

aggr with average

Hi i am using aggr function to derive a sum but i need to slice the data into quarter  where the subtotal should be average of 3 month attched hereiwth  is the data for the same

Thanking You

Vinayagam

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Ok, you want averages for horizontal total and sum for vertical total of AVGPO, right?

Then you need to use Dimensionality() and SecondaryDimensionality() to switch between different expressions on total cells.

See attached AVGPO2 expression.

View solution in original post

8 Replies
swuehl
MVP
MVP

Maybe like attached?

Anonymous
Not applicable
Author

Thanks Sir

But if u c the total below the centre its is giving avg wherein i require the sum of average

Thanking You

Vinayagam

swuehl
MVP
MVP

Ok, you want averages for horizontal total and sum for vertical total of AVGPO, right?

Then you need to use Dimensionality() and SecondaryDimensionality() to switch between different expressions on total cells.

See attached AVGPO2 expression.

qlikviewwizard
Master II
Master II

Hi swuehl

Good one.

qlikviewwizard
Master II
Master II

Hi vinayagam.121

swuehl

Has given in PO TEST_2.qvw in AVGPO2.

Which value do you want to get?

Anonymous
Not applicable
Author

Exactly sir  thank u

Anonymous
Not applicable
Author

sir in the same line could we get the sum of the subtotal VERTICAL total of horizontal avg

swuehl
MVP
MVP

If I've understood correctly, just change the order of dimensionality checks:

=if( SecondaryDimensionality()=0,

avg( aggr( SUM(PO)/ COUNT(DISTINCT(Date)), Centre, MONTHNAME)),

if( Dimensionality()=0,

sum( aggr( SUM(PO)/ COUNT(DISTINCT(Date)), Centre, MONTHNAME)),

SUM(PO)/ COUNT(DISTINCT(Date))

))