Calculated fields based on timestamp fields

HI Metabase admins,

I want to graphically compare this years with last years sales in a dual series bar chart. I see that this might be easily achieved with the dashboard method to include the second (last year’s) series. This would necessitate though that a calculated field that equals sales_date - 365 be included so that two years of sales can be overlayed and can therefore shown sequenced by month jan 18, jan 19, feb 18 feb 19 etc.

The limitation is that one cannot construct the formula on time date or date fields, the sales_date field is not in the select list for formula generation.

would this be easy to implement>
thanks much,

Hi @crwheelr
Correct, this can somewhat be created with combining two questions on a dashboard.
Currently you would need to make the query in SQL, but there has been some work on window functions, which makes it possible to compare periods in the interface - it’s not expected to be finished by the upcoming 0.33.