Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

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

Tags (2)
4 Replies
MVP
MVP

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

Not applicable

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 .

MVP
MVP

Re: Why sum is not working ?

Try to post a sample app expaining expected output.

mangalsk
Contributor III

Re: Why sum is not working ?

Hello,

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

Community Browser