Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I have data with columns "Date", "Cusotmer" and "This month purchase count" as shown in the table below, is it possible to calculate the "Last month purchase count" with the Prepare recipe?
|Date||Customer||This Month Purchase Count||Last Month Purchase Count|
You can do this using a Window recipe.
If your Date column is a string, first you'll need to parse it to a date. You can do this by using a "Parse date" step in a Prepare recipe as shown below:
Be sure that the type of the column is set to "date" (highlighted above).
Once you have a parsed date column, you can create a Window recipe with the following settings:
Aggregations (be sure to select the "Lag" aggregation):
Here's what the output dataset looks like: