Calculation of Percentiles (fractile within fractile)
My data set is:
My first task is to calculate 90th percentile per Position. That I can achieve easy with expression Fractile(Salary, .9)
My second task is what got me totally stuck and out of ideas I have to implement ability for user to exclude salaries above or equal 90th percentile and to recalculate 90th percentile again...per position.
So what I have achieved is:
1. Created load script
Load * Inline
"Hide Above 90th Percentile"
2. Created a listbox with checkbox type:
3.Created variable v90:
4. In my straight table Percentile per Position created expression:
So the result I get is incorrect. Variable v90 gets calculated before chart and it's value is for all the positions. So salary in the expression above is compared not by 90th percentile per position, but whole set of positions. Is it possible to calculate it per row level/single position? That it would show correct 90th Percentile per position in the chart below. Now it shows incorrect for B and C. We can see correct values only if we select single positions.
Workaround to create variables for each of positions wouldn't work since in a real life application I have hundreds of different positions.