Using timeSlice function with Grafana


I have a question related to timeSlice function which is not working as I expect. As quite a new to Grafana and time series it’s possible that I don’t understand the functionality correctly.

My aim is to create monthly KPIs based on the cumulative counters and for that I’m using Integral function and then trying with timeSlice to get the cumulative value from wanted period. For instance August data: timeSlice(series, “20170801”, “20170831”). My problem is that Grafana’s time range alters the values.

For August it is showing the correct data only when the time range is set to August or alternatively in this case Previous month. If I look the value with time range from 1st August – until now the August KPI contains also values from September, although I would have expected the timeSlice to filter everything away after August.

I would like to know if the target I’m aiming is possible to do with timeSlice or some other way in Grafana. I know there is the Time range Override relative time, but what I’m looking for are fixed dates.

Any help is appreciated.

Not sure how timeSlice works , but if your experience is correct then the time range will affect it the way you mentioned. Not sure there is a way to change that from the Grafana side.