Search code examples
apache-superset

Is Superset Time Range Dynamic?


I'm creating a chart and I can therefore use the 'advanced' time range option. Since I only want to see data from the start of the year to now. Therefore:

If now = 2022-12-01 then I expect that when I load the chart the "now" will always be the current date.

I cant see anything in the documentation that discusses this chart filter in depth. Is it static or dynamic does anyone know?

Example Image of setting the time range on a chart

1

It seems to capture now as today, however the "Actual time range" looks to be a hardcoded range. Its not clear what happens once I save the chart.


Solution

  • i had the same problem when i started out with superset. From what i found out at the moment there is no fancy way to achieve this with the GUI alone. By default the time range is dynamic. To get data for a specific time range we did a query in the Advanced tab

    Screenshot of advanced time range config

    In the START field use datetrunc(datetime('now'), year) In the END field use datetime('now')

    To vary the time range you can swap out year in the start field with day, month, week or an absolute date.