A window function is used to perform calculations across a group of rows on a dataset. A set of rows is termed a window. You can use window functions to perform summations and calculations based on a rolling window of data, relative to the current row.
To apply window functions
1. Click the Transform menu and select the Window functions option.
2. Enter a name for the new column in the New column name field.
3. You can insert the functions in the Formula field by typing the function names, or use the intelliSense to choose functions. You can also filter and search for functions to include in your expression using the Click to insert functions section.
4. You can add parameters to the formula, or use intelliSense to choose columns. You can also search for column names in the Click to insert columns section.
5. Choose the columns using which you want to group the rows in the Group rows by field. This specifies the column(s) using which you want to group any aggregate function. Column order determines the group's hierarchy.
6. Choose the columns using which you want to sort the rows in the Sort rows by field. This specifies the column(s) and order by which you want to sort the rows.
7. DataPrep shows a live preview of the changes made to the formula when you click on the Preview button.
8. Click Apply to apply the Window function transform.
9. DataPrep will take you to the new column created by the window function.
SEE ALSO