Summed hourly trend data from n days

Hello!
What kind of approaches there is if you want to show for example hourly data from 00:00 to 23:00 but the data should be summed for example from 30 days period?
So let say we have schema for Orders

cube('Orders', {
  measures: {
    count: {
      type: `count`,
    },
  },
  dimensions: {
    id: {
      sql: `id`,
      type: `number`,
      primaryKey: true,
    },
    order_timestamp: {
      sql: `${CUBE}."order_timestamp"`,
      type: `time`,
    }
  }
});

And I want to see how many orders have been placed in the last 30 days during every hour to see for example if there’s any trends for “rush hours” etc.

What kind of measures there should be included? And what kind of time_dimensions should be used in the query (“Today by Hour”)?
What if we want to have dynamic time period (30 days, 2 weeks, 4 months etc.) for the summed results, do we need to do measures for every case?

Thanks in advance!

Hi @janne !
You should be able to apply filters to get only records from 00:00 to 23:00. As for the summed data I would take a closed look at the runningTotal measures type:
https://cube.dev/docs/schema/reference/types-and-formats#running-total
and rollingWindow param:
https://cube.dev/docs/schema/reference/measures#parameters-rolling-window