How to get the series data count for a specific/custom time range/period for a given date range

Hi All,
I have a basic request, where I want to get the volume count of a data for a specific time range/period given for any day.

Datasource: Influxdb1.7 and ELK7+
Grafana: v6.4.2
Count of hits between “8.00 am” to “5.00 pm” for Yesterday.
Count of hits between “8.00 am” to “5.00 pm” for last 7-days.
Count of hits between “8.00 am” to “5.00 pm” for week days (Mon-Fri)

I know this is quite possible if we have added flags(0/1 or Offline/Online) for the mentioned time ranges, and then use the same in the grafana query. But what-if the flags were not inserted along with time series data (raw data).

This could also be possible even with continuous queries where the data is aggregated for the specified time range and stored in a different table/measurement/index. Use this measurement/index in your grafana query to pull the stats. But this increases the series-cardinality and storage size.

Is there is a better way to achieve this.
Any improvements for this custom time period in the recent releases?


I have come across the following proposals but are they implemented?