
Re: sum added with another sum
Stefan Wühl Jun 22, 2015 3:56 PM (in response to José Luis Rojas)Just need to add a closing bracket at the end:
sum (if ( (sum (VALOR_X) / SUM (VALOR_Y)) * 100 <25, QTY))

Re: sum added with another sum
Rob Wunderlich Jun 22, 2015 9:43 PM (in response to Stefan Wühl )Stefan, Isn't this a nested aggregation  that requires an aggr()?
Rob

Re: sum added with another sum
Stefan Wühl Jun 23, 2015 2:15 AM (in response to Rob Wunderlich )Oh, yes!
Must have been blinded ...
Dozetech, where / in which context are you using this expression? As Rob correctly said, you need to use advanced aggregation to be able to embed an aggregation function linke sum() into another aggregation function.



Re: sum added with another sum
José Luis Rojas Jun 23, 2015 7:49 AM (in response to José Luis Rojas)Good Morning
I do a grouping as a percent range. Example: expense / Billing is less than 25% then sum amount.
I am unable to use the aggr ().
sum (if (aggr((sum (VALOR_X) / SUM (VALOR_Y)) * 100 <25), QTD)).

Re: sum added with another sum
Stefan Wühl Jun 23, 2015 8:45 AM (in response to José Luis Rojas)Expense / billing per which dimension?
You would need to add these dimension(s) as dimensions to the aggr() function, like
sum( aggr( if( sum(VALOR_X) / sum(VALOR_Y) < 0.25, QTD), Dim1, Dim2, ...))
Replace Dim1, Dim2, ... with the dimensions you need to group by your percentage calculation.
(And either take care that QTD has a single value per these dimensions, or aggregate QTD, too.)
