It is recommended to get familiar with rank() function before proceeding with this tutorial. |
For this tutorial, we will leverage Data Set loaded with exam scores.
Data set includes two columns:
data |
Percentile (or centile) is the value of a variable below which a certain percent of observations fall. For example, the 20th percentile is the value (or score) below which 20 percent of the observations may be found. |
You desire to create table showing percentile next to score for each student.
int records = aggregatePrevLevel(1){L_ID_COUNT} int rank = rank() {M_SCORE} double percentile = 1-(rank/records) return percentile |
percentile |
A value which divides a set of data into equal proportions. Examples are median, quartile and decile. |
You desire to create KPI label showing the median of exam scores.
int records = L_ID_COUNT double groups = 100/@quantile int key = round(records-records/groups) double median = 0 membersSum('L_ID'){ rank = rank(){M_SCORE} if (rank == key){ median = M_SCORE } } return median |
quantile |