Skip to main content

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 NameDescription
1.Step nameSpecify the name of the step as it appears in the workflow workspace. This name has to be unique in a single workflow.
2Group fields tableSpecify 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.

3New Field NameSpecify the name you want this new field to be named on the stream (for example PREV_ORDER_DATE).
4SubjectSpecify the existing field to grab (for example ORDER_DATE) .
5TypeSpecify 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.

6NSpecify the number of rows to offset (backwards or forwards).