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 January 2023 Quantities Sold February 2023 Quantities Sold March 2023 Quantities Sold April 2023 Quantities Sold May 2023 Quantities Sold June 2023 Quantities Sold July 2023 Quantities Sold August 2023 Quantities Sold September 2023 Quantities Sold October 2023 Quantities Sold November 2023 Quantities Sold December 2023
Product 0 148 133 106 82 109 152 184 127 138 121 155 138
Product 1 135 161 184 199 184 97 143 160 121 120 151 140
Product 2 207 109 148 99 124 107 105 97 179 149 147 191
Product 3 161 139 117 110 158 209 115 106 173 118 144 172
Product 4 122 92 127 147 105 136 142 134 123 215 155 151
Product 5 151 151 129 142 183 185 164 123 136 137 90 99
Product 6 79 138 151 156 87 150 193 192 159 123 142 138
Product 7 137 112 149 166 157 216 91 118 131 122 138 152
Product 8 118 140 137 111 127 150 138 137 68 162 119 97
Product 9 141 95 192 118 154 92 110 156 136 163 124 158