4 Replies Latest reply: Apr 2, 2014 4:49 AM by Mangal Kamble

# Why sum is not working ?

Hello,

I have a function :

if(RangeSum(Above(sum({\$<[ZZZ] ={'NO'}>} (if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'13]+[PPP'13], 0)))/sum(TOTAL <Subcategory> if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'06]+[PPP'06], 0)), 0, RowNo()))<0.8,'A','B')

which is working properly.

However I don't know why I can't sum 'A' or sum 'B" ?

e.g.

sum( if(RangeSum(Above(sum({\$<[ZZZ] ={'NO'}>} (if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'13]+[PPP'13], 0)))/sum(TOTAL <Subcategory> if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'06]+[PPP'06], 0)), 0, RowNo()))<0.8,'A','B') )

Is it any limits to use sum in one expression ? ( like in excel 7 times 'if' )

• ###### Re: Why sum is not working ?

Yes, you can't use one aggregation function in another directly. To do it you have to use advanced method using AGGR(). Like:

Sum ( Aggr( Sum(Amt) , Dimension1, Dimendsion2, ...))

• ###### Re: Why sum is not working ?

Hi tresesco ,

When I am trying to do :

sum( aggr( if(RangeSum(Above(sum({\$<[ZZZ] ={'NO'}>} (if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'13]+[PPP'13], 0)))/sum(TOTAL <Subcategory> if ([SSS'13]+[PPP'13]-[SSS'06]-[PPP'06]> 0, [SSS'06]+[PPP'06], 0)), 0, RowNo()))<0.8,'A','B') ))

is no use .

• ###### Re: Why sum is not working ?

Try to post a sample app expaining expected output.

• ###### Re: Why sum is not working ?

Hello,

You are using sum outside if condition may be that's why its not working