Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marcus_sommer

statistical aggregations - parts between frac 0.1 and 0.9

Hello,

I want do some statistical aggregations about the distribution from a certain datas over various time-periods. For this I use avg/median/fractile which are working fine. But now I need to sum/avg parts of this, for example the 80% which are between fractile(sum(value), 0.1) and fractile(sum(value), 0.9). Any ideas how this could be solved?

- Marcus

8 Replies
tresesco
MVP
MVP

Not sure if understood right. Is it somehow close to this: Show Bottom 5 in Bar Chart??       ?

marcus_sommer
Author

It goes in the right direction but don't worked for me. My case is a bit more complicated then I need to use aggr within the set analysis and it seems that comparing one aggr-result against another aggregation isn't possible:

avg({< F2 = {"=avg(aggr(sum(F1), F2))>fractile(sum(F1), 0.9)"}>} F1)

don't worked although both expression-parts are working alone and with comparing against a fixed value the expression worked:

avg({< F2 = {"=avg(aggr(sum(F1), F2))>1000"}>} F1)

- Marcus

marcus_sommer
Author

Unfortunately it didn't worked.

Kushal_Chawda

is it possible to create the below Aggregation in Script

1) avg(aggr(sum(F1), F2))



2) fractile(sum(F1), 0.9)


Compare 1) & 2) in Script & create Flag then finally you can do avg({<Flag={1}>}F1)

marcus_sommer
Author

Script pre-calculations aren't possible - it needs to be flexible to selections like periods, areas and categories and also the fractile-parts should be per variable eligible.

tresesco
MVP
MVP

I would try with IF and aggr(), rather than Set Expression.

marcus_sommer
Author

Many thanks for your help. The set analysis approach is the better one and in my expressions was only a TOTAL missing, so that this worked:

avg({< F2 = {"=avg(aggr(sum(F1), F2))>fractile(TOTAL sum(F1), 0.9)"}>} F1)

- Marcus