Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey all,
I'm writing a couple of variable to calculate KPI's and min/avg/max values of thoose KPI's. The min/avg/max should be calculated ignoring certain selections in the qvw. The problem is that the written functions can get very long. For example:
KPI = count(value)*(max(date)-min(date))
When I need to remove the filters to calculate min/avg/max then I need to use something like:
KPI_avg = avg({$<removeValue=>}count({$<removeValue=>}value)*(max({$<removeValue=>}date)-min({$<removeValue=>}date)))
I have a longer function for my KPI and an even longer selection I need to ignore.
So my question is: can I let the set analysis be inherited by defining my 'ignore selection' only once? for ex:
KPI_avg_wanted = avg({$<removeValue=>}count(value)*(max(date)-min(date)))
I tried something similar to the above but that doesn't work. Anyone got suggestions? thanks!
Hi,
You need to give set analysis expression for every individual method you use in the expression. So, I don't think it is possible, you have to specify like this
KPI_avg = avg({$<removeValue=>}count({$<removeValue=>}value)*(max({$<removeValue=>}date)-min({$<removeValue=>}date)))
Regards,
Jagan.
Thanks, that's what I thought but I had hoped to be wrong
I believe something like
= avg({$<removeValue=>}count({$<removeValue=>}value)* max({$<removeValue=>}date)-min({$<removeValue=>}date)))
shouldn't work at all, since you are embedding aggregation functions into another aggregation function. You need to use advanced aggregation to handle this.