8 Replies Latest reply: Jul 20, 2015 7:07 AM by Stefan Wühl

# 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

• ###### Re: aggr with average

Maybe like attached?

• ###### Re: aggr with average

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

• ###### Re: aggr with average

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.

• ###### Re: aggr with average

swuehl

Has given in PO TEST_2.qvw in AVGPO2.

Which value do you want to get?

• ###### Re: aggr with average

Hi swuehl

Good one.

• ###### Re: aggr with average

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

• ###### Re: aggr with average

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

))