Analytic Query
Description
Analytic Query is a step in the Statistics Plugin for Process Studio Workflows. Analytic Query step is used to execute analytic queries over a sorted data set. This step allows you to peek forward and backwards across rows (e.g. LEAD, LAG, FIRST, LAST).
Configurations
No. | Field Name | Description |
---|---|---|
1. | Step name | Specify the name of the step as it appears in the workflow workspace. This name has to be unique in a single workflow. |
2 | Group fields table | Specify the fields you want to group. Click Get Fields to add all fields from the input stream(s). The step will do no additional sorting, so in addition to the grouping identified (for example CUSTOMER_ID) here you must also have the data sorted (for example ORDER_DATE). |
Analytic | ||
Functions table: | Specify the analytic functions to be solved. Examples of common use cases are: - Calculate the "time between orders" by ordering rows by order date, and LAGing 1 row back to get previous order time. - Calculate the "duration" of a web page view by LEADing 1 row ahead and determining how many seconds the user was on this page. | |
3 | New Field Name | Specify the name you want this new field to be named on the stream (for example PREV_ORDER_DATE). |
4 | Subject | Specify the existing field to grab (for example ORDER_DATE) . |
5 | Type | Specify the type of analytic function: Lead - Go forward N rows and get the value of Subject. Lag - Go backward N rows and get the value of Subject. |
6 | N | Specify the number of rows to offset (backwards or forwards). |