h not in months %}
                                        {% set _ = months.update({month: {'total': 0, 'by_category': {}, 'by_user': {}, 'by_card': {}}}) %}
                                    {% endif %}
                                    
                                    {% set _ = months[month].update({'total': months[month].total + expense.amount}) %}
                                    
                                    <!-- Calculate categories -->
                                    {% if exp