# \[SOLVED\] "This week" timerange strange behavior ($\_\_range) with slow counter

**URL:** <https://community.grafana.com/t/solved-this-week-timerange-strange-behavior-range-with-slow-counter/12782>\
**Category:** Stat Panel\
**Created:** [December 12, 2018, 2:13pm UTC](https://community.grafana.com/t/solved-this-week-timerange-strange-behavior-range-with-slow-counter/12782 "2018-12-12T14:13:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gael077](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@gael077](https://community.grafana.com/u/gael077)\
**Post date:** [December 12, 2018, 2:13pm UTC](https://community.grafana.com/t/solved-this-week-timerange-strange-behavior-range-with-slow-counter/12782/1 "2018-12-12T14:13:18Z")

</div>

Hello everyone here,

I use Grafana version 5.3.2 with a prometheus data source

My request is the following:

> Blockquote  
> sum (  
> + max\_over\_time (my\_counter\_total[$\_\_range])  
> - min\_over\_time (my\_counter\_total[$\_\_range])  
> )

“my\_counter\_total” is a slow counter ~ 200 increase per week.

When I use the time range filter “This week so far”, it works fine and shows the right value, ~100, when I run the request on Wednesdays.  
When I use the time the time range filter “This week”, the value is not correct, ~60 to ~80, when I run the request on Wednesdays.

To narrow down the problem, I use the time selector from _Monday_ 00:00:00 to _Sunday_ 23:59:59, and it results in the same wrong result.  
Then I use the time selector _Monday_ 00:00:00 to _Next\_Monday_ 00:00:00, and the result is then correct.

The other time filter work perfectly.

Anyone here have seen this issue, or could help me to understand it? Any help would be very appreciated.  
Thanks  
Gael

---

<div class="post-metadata">

**Author:** ![gael077](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@gael077](https://community.grafana.com/u/gael077)\
**Post date:** [December 14, 2018, 5:11pm UTC](https://community.grafana.com/t/solved-this-week-timerange-strange-behavior-range-with-slow-counter/12782/2 "2018-12-14T17:11:10Z")

</div>

I found out that this problem comes from the ‘\_\_range’ variable which is “too rounded”.

Using ‘\_\_range\_s’ instead solved my problem.

> Blockquote  
> sum (  
> + max\_over\_time (my\_counter\_total[${\_\_range\_s}s])  
> - min\_over\_time (my\_counter\_total[${\_\_range\_s}s])  
> )
