Quantile
- 1 Minute to read
- Print
- DarkLight
- PDF
Quantile
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
General: Quantile
Groups data into a specified number of segments, where each segment contains the same number of records.
Purpose
Use this function to:
- Group data into relative ranks
- Create percentiles, quartiles etc
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Low |
DataType | Continuous |
DataSize | Byte |
Example Return Value: 1.....S where S is the number of segments.
Parameters
Parameter | JSON | Description |
---|---|---|
Table | “targetTable”: “MyTableName” | The target table on which the new field will be created |
Filter | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter recordset will be returned as null. |
Function | "function":"quantile" | Quantile |
Quantile Field | “p1”: “QuantileFieldName” | Required. Supports:
Quantile field is sorted using an alphanumeric sort before being allocated into segments. |
Elements | “p2”:"NumberofElements" | Required. Supports:
10,20,50 and 100 are available as a drop down. To specify a different number, type in a number between 2 and 250 e.g. 7 |
JSON Sample
{
"method": "BuildBakedField",
"project": "D3",
"targetTable": "transactions",
"overwrite": true,
"name": "price_decile",
"function": "quantile",
"p1": "price",
"p2": "10"
}
Usage Notes
Quantiles are one of the more processing intensive of engineering functions so may take a little longer than others to execute.
See Also:
- Engineering | Expression Field
- Engineering | Decodes
- Engineering | Banded Fields
Example
Example | Details |
---|---|
Description | Create an income decile |
Input |
|
Sample |
Was this article helpful?