# Can elasticsearch do a running tally of a number field?

**URL:** <https://discuss.elastic.co/t/can-elasticsearch-do-a-running-tally-of-a-number-field/7541>\
**Category:** Elasticsearch\
**Created:** [May 2, 2012, 3:37pm UTC](https://discuss.elastic.co/t/can-elasticsearch-do-a-running-tally-of-a-number-field/7541 "2012-05-02T15:37:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![redCashion](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redcashion/32/2895_2.png) [@redCashion](https://discuss.elastic.co/u/redCashion)\
**Post date:** [May 2, 2012, 3:37pm UTC](https://discuss.elastic.co/t/can-elasticsearch-do-a-running-tally-of-a-number-field/7541/1 "2012-05-02T15:37:34Z")

</div>

If I have a facet like

"histogram": {  
"key\_field": "timestamp",  
"value\_field": "amount",  
"time\_interval": "1d"  
}  
I get a result set back like

{  
key: 1222732800000  
count: 642  
min: -985  
max: 483.25  
total: 1544.4000024795532  
total\_count: 642  
mean: 2.4056074804977463  
}  
Is there a way that I can get peak high and peak low of the tally? In other words if amount was a number series like:

-4, -8, 10, -3, 30, -20  
What i need is a way to determine that the tally's peak low was -12 and its peak high was 25.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 4, 2012, 1:31pm UTC](https://discuss.elastic.co/t/can-elasticsearch-do-a-running-tally-of-a-number-field/7541/2 "2012-05-04T13:31:59Z")

</div>

I don't understand...

On Wed, May 2, 2012 at 6:37 PM, redCashion [xperts@gmail.com](mailto:xperts@gmail.com) wrote:

> If I have a facet like
> 
> "histogram": {  
> "key\_field": "timestamp",  
> "value\_field": "amount",  
> "time\_interval": "1d"  
> }  
> I get a result set back like
> 
> {  
> key: 1222732800000  
> count: 642  
> min: -985  
> max: 483.25  
> total: 1544.4000024795532  
> total\_count: 642  
> mean: 2.4056074804977463  
> }  
> Is there a way that I can get peak high and peak low of the tally? In other  
> words if amount was a number series like:
> 
> -4, -8, 10, -3, 30, -20  
> What i need is a way to determine that the tally's peak low was -12 and its  
> peak high was 25.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Can-elasticsearch-do-a-running-tally-of-a-number-field-tp3955288.html](http://elasticsearch-users.115913.n3.nabble.com/Can-elasticsearch-do-a-running-tally-of-a-number-field-tp3955288.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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, 3:30am UTC](https://discuss.elastic.co/t/can-elasticsearch-do-a-running-tally-of-a-number-field/7541/3 "2017-07-06T03:30:06Z")

</div>

Closed on July 6, 2017, 3:30am UTC


