# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today MVP & Luminary

## 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
Highlighted MVP

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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

Highlighted MVP

## Re: statistical aggregations - parts between frac 0.1 and 0.9

Highlighted MVP & Luminary

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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

Highlighted MVP & Luminary

## Re: statistical aggregations - parts between frac 0.1 and 0.9

Unfortunately it didn't worked.

Highlighted MVP

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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)

Highlighted MVP & Luminary

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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.

Highlighted MVP

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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

Highlighted MVP & Luminary

## Re: statistical aggregations - parts between frac 0.1 and 0.9

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