Site icon i2tutorials

Amazon QuickSight – median

Amazon QuickSight – median

 

The ‘median’ function in Amazon QuickSight is used to compute the median value of a measure, optionally grouped by one or more dimensions.

 

Syntax

#Start#
median(measure, [group-by level])
#End#

 

This function takes one argument:

 

 

Suppose we have a dataset that contains information about test scores for students and we want to find the median score by grade level. We can use the median() function in Amazon QuickSight to do this.

 

To find the median score by grade level, we can create a new visual in Amazon QuickSight and add a table with the following settings:

 

This will result in a table that shows the median test score by grade level.

 

Alternatively, we can create a calculated field in Amazon QuickSight with the following expression:

 

Example

#Start#
median(TestScore, [GradeLevel])
#End#

 

This expression will compute the median test score by grade level.

 

For instance, if our test score data is as follows:

Student IDGrade LevelTest Score
19th85
210th92
39th76
411th88
510th90
69th82

 

Then, the median test score by grade level will be:

 

Example

#Start#
median(TestScore, [GradeLevel]) = {'9th': 82.5, '10th': 91, '11th': 88}
#End#

 

In this example, we can see that the median() function has computed the median test score by grade level, resulting in a useful metric that can inform our educational decisions.

 

Exit mobile version