Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
timwhite
Contributor II
Contributor II

Calculating a percentile for a student test score

I have an app that contains a list of students with their test scores.  When I select a single student, I would like to have a text box on the screen show me a calculation of the student's test score percentile.  In other words, I would like to know what percentage of other student's test scores are equal than or lower to the selected student's test score.  

The field that will be selected to identify the specific student is called [student_ID], and the test score field is called [test_score].  Unfortunately, I can't post a screen shot of the data due to privacy concerns.

Is this possible?  

Labels (1)
2 Solutions

Accepted Solutions
rubenmarin

Hi, in the text box you can use an expresion like: 

Count({<test_score={"<=$(=Max(test_score))"},student_ID>} student_ID) / Count({<student_ID>} student_ID)

View solution in original post

howdash
Creator II
Creator II

Small tip. If you want your expression to exclude selected student from calculation of test score percentile, I recommend modifying the expression to be like this:

Count({<test_score = {"<=$(=test_score)"}, student_ID = E(student_ID) >} student_ID) / Count({<student_ID>} student_ID)

 

For example, let's say you have 100 students. You select a student that has a test score of 80. Let's say there are 59 other students that have a test score of 80 or less. The expression above, will return 59%.

Whereas, the expression that Rubenmarin suggested will return 60% because it will count the student you selected as well as the 59 students that have the score of 80 or less.

Not sure what the exact requirement you have, but I wanted to throw that out in case you'll need to exclude selected student from calculation of score percentiles.

View solution in original post

4 Replies
rubenmarin

Hi, in the text box you can use an expresion like: 

Count({<test_score={"<=$(=Max(test_score))"},student_ID>} student_ID) / Count({<student_ID>} student_ID)

timwhite
Contributor II
Contributor II
Author

@rubenmarin Thank you so much!! This does exactly what I needed. 

howdash
Creator II
Creator II

Small tip. If you want your expression to exclude selected student from calculation of test score percentile, I recommend modifying the expression to be like this:

Count({<test_score = {"<=$(=test_score)"}, student_ID = E(student_ID) >} student_ID) / Count({<student_ID>} student_ID)

 

For example, let's say you have 100 students. You select a student that has a test score of 80. Let's say there are 59 other students that have a test score of 80 or less. The expression above, will return 59%.

Whereas, the expression that Rubenmarin suggested will return 60% because it will count the student you selected as well as the 59 students that have the score of 80 or less.

Not sure what the exact requirement you have, but I wanted to throw that out in case you'll need to exclude selected student from calculation of score percentiles.

timwhite
Contributor II
Contributor II
Author

@howdash Great tip - Thanks for adding to the conversation.