Time Series


    A time series is a series of data points indexed in time order. Most commonly, a time series is a sequence taken at
    successive equally spaced points in time. - from Wikipedia

    In this example we can see how many pieces of each product were sold each month.
    
class TimeSeries(SlickReportView):
    
    report_model = SalesLineTransaction
    date_field = 'transaction_date'
    group_by = 'product'
    columns = ['name']

    time_series_pattern = 'monthly'
    # Possible options are: daily, weekly, semimonthly, monthly, quarterly, semiannually, annually and custom.

    time_series_columns = [
        SlickReportField.create(method=Sum, field='quantity', name='quantity__sum', verbose_name=_('Quantities Sold'))
        # we can have multiple ReportField in the time series columns too !
    ]

                

Live Example

Filters

Results

Name Quantities Sold 2023/01/01 - 2023/02/01 Quantities Sold 2023/02/01 - 2023/03/01 Quantities Sold 2023/03/01 - 2023/04/01 Quantities Sold 2023/04/01 - 2023/05/01 Quantities Sold 2023/05/01 - 2023/06/01 Quantities Sold 2023/06/01 - 2023/07/01 Quantities Sold 2023/07/01 - 2023/08/01 Quantities Sold 2023/08/01 - 2023/09/01 Quantities Sold 2023/09/01 - 2023/10/01 Quantities Sold 2023/10/01 - 2023/11/01 Quantities Sold 2023/11/01 - 2023/12/01 Quantities Sold 2023/12/01 - 2024/01/01