superset
superset copied to clipboard
sqlite month grain is calculating wrong
I noticed the sqlite month grain is removing Day of the Month when it should be removing (day of the month -1).
'sqlite': (
Grain('Time Column', _('Time Column'), '{col}'),
Grain('day', _('day'), 'DATE({col})'),
Grain("week", _('week'),
"DATE({col}, -strftime('%w', {col}) || ' days')"),
Grain("month", _('month'),
"DATE({col}, -strftime('%d', {col}) || ' days')"),
),
should be as below otherwise month grouping gives you the prior month.
Grain("month", _('month'),
"DATE({col}, -(strftime('%d', {col}) -1) || ' days')"),
),