Skip to main content

tokenize (Aggregate Function)

This functions returns the pth percentile value of a given argument.

Syntax

<DOUBLE> math:percentile(<INT|LONG|FLOAT|DOUBLE> arg, <DOUBLE> p)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
argThe value of the parameter whose percentile should be found.INT LONG FLOAT DOUBLENoYes
pEstimate of the percentile to be found (pth percentile) where p is any number greater than 0 or lesser than or equal to 100.DOUBLENoYes

Example 1

CREATE STREAM InValueStream (sensorId int, temperature double);

insert into OutMediationStream
select math:percentile(temperature, 97.0) as percentile
from InValueStream;

This function returns the percentile value based on the argument given. For example, math:percentile(temperature, 97.0) returns the 97th percentile value of all the temperature events.