Discussion Board for collaboration on QlikView Scripting.
I need to create an expression as follows:
sum (if ((sum (VALOR_X) / SUM (VALOR_Y)) * 100 <25, QTY).
It does not give error in syntax, but does not return the information.
How can I do this?
Can anyone help me?
Just need to add a closing bracket at the end:
sum (if ( (sum (VALOR_X) / SUM (VALOR_Y)) * 100 <25, QTY))
Stefan, Isn't this a nested aggregation -- that requires an aggr()?
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.
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)).
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.)