Skip to main content

approx_percentile

approx_percentile calculates the value at a given percentile of a distribution of values. The value found has percentile approximately equal to the given percentile, within some error term (0.01, by default).

Returns: decimal

Table 1.

Parameter

Type

Description

value

decimal, double

the values to be counted

percentile

decimal, double

the percentile of the distribution to be found. Must be between 0.0 and 1.0, and must be the same for all values

error

decimal

the maximum allowable error of the percentile to be found. Must be greater than 0.0 and less than 1.0, and must be the same for all values. This argument is optional, with default value 0.01



Example

Query

PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-aggregation-sample-queries/>
PREFIX agg: <http://data.world/function/aggregate#>

SELECT (agg:approx_percentile(?foo, .4) AS ?approx_percentile)
{
    [ :col-aggregations-foo ?foo ]
}

Try the query

Table 1. Results

approx_percentile

3.0