Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the sum of following expression and display the sum in KPI and also FTM value for it.
But since nested aggregation isn't allowed in Qlik, i'm not able to do so. Anyone please suggest a solution.
(if(Sum(a) > Sum(b) ,
if(Sum(c) > Sum(b),
if((Sum(c)-Sum(b)) > (Sum(a)-Sum(b)),
(Sum(a)-Sum(b))*Sum(d),
(Sum(c)-Sum(b))*Sum(d))))
This looks like it should work.
It isn't a nested aggregation - a nested aggregation is something like a SUM of a SUM - in your expression you're not doing that - you just have some if conditions.
Could it be failing because Sum(a) < Sum(b), or Sum(c) < Sum(b) ? You don't have a calculation defined for either of those conditions.
ok, so what do you expect to see if Sum(a) < Sum(b) or Sum(c) < Sum(b)?
Just an FYI - you're missing a closing bracket on your expression
PFA a little demo app, with your expression working
Thanks for your reply,
My main motive is to display the ftd and ftm value for the expression using KPI chart.
But it isnt showing any value.
We're not really getting anywhere here.
I'd suggest you upload a small sample app to illustrate the issue, and indicate exactly what results you are looking for.
To sum the result of your expression you can try using AGGR
Sum(
Aggr([Your expression], [List of dimensions you want to sum across])
)