Performs time series analysis operations on date-sequenced data, calculating moving averages and other trend indicators to reveal patterns, seasonality, and long-term trends over time.
When to Use
Smooth out short-term fluctuations in time-based data
Identify underlying trends in noisy data
Create comparison metrics across different time periods
Analyze seasonality in time series data
Generate predictive indicators for forecasting
Reduce the impact of outliers or anomalies
Prepare data for visualization with trend lines
How It Works
Takes a dataset with a date field and specified numeric columns
Sorts the data chronologically by the date field
Applies requested time series operations (currently supporting moving averages)
Creates new columns with calculated time series metrics
Maintains the original data structure with added derived columns
Parameters
Required
date_field (string) - Column containing date values for sequencing
operations (array) - List of time series operations to perform:
type - Operation type (sma, ma, or moving_average for simple moving average)
column - Numeric column to analyze
period - Time window size (e.g., 7 for 7-day moving average)
Supported Operations
Simple Moving Average (SMA)
Calculates the unweighted mean of the previous n data points.
type: sma
column: revenue
period: 7
Output column named: revenue_sma_7
Input Requirements
Dataset must contain the specified date field
Date field must contain valid date values (parseable by strtotime())
Columns referenced in operations must contain numeric values
Data should ideally be at a consistent time interval (daily, weekly, etc.)
Output
Data
Original dataset with additional columns for each time series operation
New column names follow the pattern: {column}_{operation}_{period}
Chronological sorting by date field
Example Usage
Basic Moving Averages
timeSeries:
date_field: transaction_date
operations:
- type: sma
column: revenue
period: 7
- type: sma
column: revenue
period: 30
- type: sma
column: order_count
period: 15