Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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' )

4 Replies
tresesco
MVP
MVP

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
Author

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 .

tresesco
MVP
MVP

Try to post a sample app expaining expected output.

mangalsk
Creator III
Creator III

Hello,

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