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 2021/01/01 - 2021/02/01 Quantities Sold 2021/02/01 - 2021/03/01 Quantities Sold 2021/03/01 - 2021/04/01 Quantities Sold 2021/04/01 - 2021/05/01 Quantities Sold 2021/05/01 - 2021/06/01 Quantities Sold 2021/06/01 - 2021/07/01 Quantities Sold 2021/07/01 - 2021/08/01 Quantities Sold 2021/08/01 - 2021/09/01 Quantities Sold 2021/09/01 - 2021/10/01 Quantities Sold 2021/10/01 - 2021/11/01 Quantities Sold 2021/11/01 - 2021/12/01 Quantities Sold 2021/12/01 - 2022/01/01
Product 0 137 117 130 185 133 120 151 102 87 135 163 174
Product 1 119 121 162 117 93 77 125 112 156 131 110 110
Product 2 139 101 127 108 104 196 168 108 102 119 169 155
Product 3 113 74 125 162 169 156 153 144 111 164 133 120
Product 4 133 140 103 90 180 148 162 147 151 168 97 58
Product 5 128 140 129 124 166 136 113 173 117 121 169 148
Product 6 158 123 153 165 128 125 130 112 165 88 103 152
Product 7 114 135 168 138 124 153 96 130 137 153 139 169
Product 8 164 156 101 155 153 141 121 148 175 196 159 100
Product 9 149 129 117 140 135 119 221 158 115 124 154 159