Lag
See the trends and patterns that emerge from transformed data using the Lag tool. Create a new, transformed dataset from your original data. For the lag, enter the New column name, the Aggregate column, the Operation, and the Lag number.
You can create multiple aggregate columns for your data. Each aggregate column is added to the data as a new column.
For example, you can use the Lag tool to view your revenue month over month. The output provides a row-by-row comparison of your data.
Note
The Lag tool only performs the operation at the end of the data. It does not make predictions about the data.
Input
The Lag tool requires one data input with numeric columns.
Configuration
Use the following configuration options to help create your Lag configuration.
Go to the Pipes module from the side navigation bar.
From the Pipes tab, click an existing pipe to open, or create a new pipe. To create a new pipe, read the Creating a pipe documentation.
In the Pipe builder, add a data source to your pipe. For more information on adding a data source, see the Data Input tool.
Click
+ Tool.The Tools modal opens, where you can add tools, such as the Aggregate tool, to your pipe.
In the Tools modal, search for Lag and then click + Add tool.
Tip
You can also find the Lag tool in the Calculate section.
Click the tool node and drag the line to the next tool to connect the tools. If you need to undo the action, click the line and then click Unlink.
In the configuration pane, enter a new column name in the New column name field.
Under Aggregate column, select the numerical column to aggregate.
Under Operation, select one of the following options:
Average
Sum
Difference
Percentage
Shift
Under Lag, enter the numeric value greater than 0 to indicate the number of lags to go backward. For example, lag 1 n-1, lag 12 n-12.
Optionally click + Lag to add another lag.
Optionally, click to select to include all lag values up to the input lag value.
Click on the tool name to rename your tool node to a meaningful name. Name your tools in a way that describes the function, not the object or the data action. For example, use “Look up rate” instead of “Join to rate table”.