Amazon QuickSight
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

percentileRank

percentileRank calculates the percentile rank of a measure or a dimension in comparison to the specified partitions. The percentile rank value(x) indicates that the current item is above x% of values in the specified partition. The percentile rank value ranges from 0 (inclusive) to 100 (exclusive).

percentileRank is supported for use with analyses based on SPICE and direct query data sets.

Syntax

The brackets are required. To see which arguments are optional, see the following descriptions.

percentileRank ( [ sort_order_field ASC_or_DESC, ... ] ,[ {partition_field}, ... ] )

Arguments

sort order field

One or more aggregated measures and dimensions that you want to sort the data by, separated by commas. You can specify either ascending (ASC) or descending (DESC) sort order.

Each field in the list is enclosed in {} (curly braces), if it is more than one word. The entire list is enclosed in [ ] (square brackets).

partition field

(Optional) One or more dimensions that you want to partition by, separated by commas.

Each field in the list is enclosed in {} (curly braces), if it is more than one word. The entire list is enclosed in [ ] (square brackets).

Example

The following example does a percentile ranking of max(Sales) in descending order, by State.

percentileRank ( [max(Sales) DESC], [State] )

The following example does a percentile ranking of Customer Region by total Billed Amount. This example uses the revenue sample data file, located in an Amazon S3 bucket. The fields in the table calculation are in the field wells of the visual.

percentileRank( [sum({Billed Amount}) DESC], [{Customer Region}] )

The following screenshot shows the results of the example, along with the total Billed Amount so you can see how each region compares.

On this page: