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 2022/01/01 - 2022/02/01 Quantities Sold 2022/02/01 - 2022/03/01 Quantities Sold 2022/03/01 - 2022/04/01 Quantities Sold 2022/04/01 - 2022/05/01 Quantities Sold 2022/05/01 - 2022/06/01 Quantities Sold 2022/06/01 - 2022/07/01 Quantities Sold 2022/07/01 - 2022/08/01 Quantities Sold 2022/08/01 - 2022/09/01 Quantities Sold 2022/09/01 - 2022/10/01 Quantities Sold 2022/10/01 - 2022/11/01 Quantities Sold 2022/11/01 - 2022/12/01 Quantities Sold 2022/12/01 - 2023/01/01