# Date histogram facet: total\_count is 0 but mean is 0 instead of null/NaN

**URL:** <https://discuss.elastic.co/t/date-histogram-facet-total-count-is-0-but-mean-is-0-instead-of-null-nan/13831>\
**Category:** Elasticsearch\
**Created:** [October 3, 2013, 12:46am UTC](https://discuss.elastic.co/t/date-histogram-facet-total-count-is-0-but-mean-is-0-instead-of-null-nan/13831 "2013-10-03T00:46:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wayne530](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wayne530/32/2071_2.png) [@wayne530](https://discuss.elastic.co/u/wayne530)\
**Post date:** [October 3, 2013, 12:46am UTC](https://discuss.elastic.co/t/date-histogram-facet-total-count-is-0-but-mean-is-0-instead-of-null-nan/13831/1 "2013-10-03T00:46:59Z")

</div>

we are seeing date histogram facet data such as:

```
        11 => 
        array (
          'time' => 1379030400000,
          'count' => 1,
          'min' => 'Infinity',
          'max' => '-Infinity',
          'total' => 0,
          'total_count' => 0,
          'mean' => 0,
        ),

```

...  
16 =\>  
array (  
'time' =\> 1379548800000,  
'count' =\> 2,  
'min' =\> 'Infinity',  
'max' =\> '-Infinity',  
'total' =\> 0,  
'total\_count' =\> 0,  
'mean' =\> 0,  
),

i assume the distinction between total\_count and count is that the latter  
is the total number of documents whereas the former are the total number of  
documents contributing to total. i therefore also assume that mean = total  
/ total\_count, which should be undefined however in this case is returning  
0 which seems wrong. we're running 0.20.1. is this a known issue? is there  
a way to correct it?

thanks,  
-w

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:13am UTC](https://discuss.elastic.co/t/date-histogram-facet-total-count-is-0-but-mean-is-0-instead-of-null-nan/13831/2 "2017-07-06T02:13:57Z")

</div>


