One of the KPI:s that we trend with our Qlik dashbards, is an average of all values belonging to a certain percentile. The only way I've come up with of calculating this is very... verbose... It works fine, though.

Does anyone have any suggestion on how this could be expressed in a more succinct manner?

There was a question on an identical problem posted a couple of years ago. I used that solution initially, but realized that it gives incorrect results for selections with sequences of repeating values that touch the percentile boundaries. For certain cases, the error becomes very large and noticeable to end-users, so it is not an acceptable approach. The KPI is also calculated in other, non-Qlik-based, systems, and it is important that users get the same output in all systems, given they provide the same input!