Skip to main content

Best 20% and worst 20 % Cases based on their duration

 

Hi everyone,

 

we are looking for a solution to the following problem.

 

We would like to get the best 20% and worst 20% of the Cases based on their duration, including all cases that fall between the scope, e.g. in a pie chart.

So we could filter on the specific cases that are in the defined scope and as an output we would like so see them individually (with Case Key and their specific duration) in an OLAP table.

 

Does anyone know what formula to use to get the relationship to each other?

Hello Julia.

you will need a combination.

Since PQL is very powerful and flexible, I believe other alternatives are possible.

This is the first option that comes to my mind now.

  • define your criteria and calculation (a KPI, for example)
  • order by the KPI (you can use the INDEX_ROW function, ascending or descending)
  • Count the number of cases and define the 20% size, and using this "size block", filter it using the INDEX_ORDER + a CASE WHENm for example.

Example:

10 cases

20% of the cases (size): 2

KPI: 0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9

Index_row asc of the kpi above: 1,2,3,4,5,6,7,8,9,10

 

worst 20%: index row <= size(2)

 

best 20%: #cases(10)-size(2)=8, so, index_row>8

 

results:

worst 20%: 0,0.1

best 20%: 0.8,0.9

 

Thanks.

DG


Reply