D toc |
---|
D s transforms |
---|
Excerpt |
---|
The The |
For example, you can compute the rolling average for a specified column for the current row value and the three preceding rows. This transform is particularly useful for processing time or otherwise sequential data.
You can apply one or more functions to your your window
transform transform step.
- For more information on window functions, see see Window Functions.
- You can also use the aggregation functions with this transform. See See Aggregate Functions.
Info |
---|
NOTE: Be careful applying this transform across a large number of rows. In some cases, the application can run out of memory generating the results, and your results can fail. |
...
D code |
---|
window value: ROLLINGAVERAGE(myValues,3) order: MyDate group: customerId |
Output: Generates a new column called, window
, which contains the result of the the ROLLINGAVERAGE
function function applied from the current row in the the myValues
column column across the the 3
rows rows forward, ordered by by MyDate
and and grouped by by customerId
.
D s | ||
---|---|---|
|
D code |
---|
window value: WINDOW_FUNCTION(arg1,arg2) order: order_col [group: group_col] |
Token | Required? | Data Type | Description |
---|---|---|---|
window | Y | transform | Name of the transform |
value | Y | string | Expression that evaluates to the window function call and its parameters |
order | Y | string | Column or column names by which to sort the dataset before the value expression is applied |
group | N | string | Column name or names containing the values by which to group for calculation |
D s lang notes |
---|
value
For the the window
transform, the the value
parameter contains the function call or calls, which define the set of rows to which the function is applied.
...
This transform uses a special set of functions. For more information on the available functions, see Window Functions.
D s | ||
---|---|---|
|
Required? | Data Type |
---|---|
Yes | String (expression) |
...
For the window
transform, this parameter specifies parameter specifies the column on which to sort the dataset before applying the specified function. For combination sort keys, you can add multiple comma-separated columns.
...
Required? | Data Type |
---|---|
Yes | String (column name) |
group
For the window
transform transform, this this parameter specifies the column whose values are used to group the dataset prior to applying the specified function. For combination grouping, you can specify multiple comma-separated column names.
...
See the individual functions for examples. See See Window Functions.
D s also label wrangle_transform_window
...