Loop through all days from start date until now

Hi :slight_smile:

I have a table with bookings of a hotel. Now I want to query this table to get a chart of how many daily active bookings there were.

My table:

  • booking_id
  • start_date
  • end_date

Now I want to loop through all days from 2017-01-01 until now and count the bookings where the day is between start_date and end_date.

Is there a way to create this with metabase? I have googled the last 2 hours and found no working solution.

Thanks a lot!

Thereโ€™s no way of doing that using the query builder, but you should be able to do that using SQL window functions.