• Status: Solved
• Priority: Medium
• Security: Public
• Views: 801

# Writing a Crystal Reports expression to get a median of Scores average

I have the following data in a SQL Table (attached sample excel file)

This data shows the number of surveys done on each person in that list and what their score was for each and every survey. Some have more surveys than others

I want to be able to write an expression in Crystal Reports calculation that shows the average MEDIAN (%age) of ALL the survey scores, and based off of that, which of the people in that list are the top 20%, and which are the bottom 20%.

Would this have to be done in two parts? I am a NEW Crystal user. Can you guys write the expression out for me?

Thanks.
sample-data.xls
0
super786
• 2
1 Solution

Commented:
The median should simply be a simple summary of the score field.

Can a person appear in both top 20% and bottom 20%
If so simply sort the records by the score and use suppression to hide the not desired records.

Suppression formula would be

RecordNumber > 0.2 * Count({SomeField}) AND RecordNumber < 0.8 * Count({SomeField})

mlmcc
0

Author Commented:
How would I calculate the summary of the score field in crystal expression form?
0

Commented:
The easy way is to put the score field on the report in the detail section
Right click the field
Click INSERT --> SUMMARY
Choose the summary you want

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.