Hello Simon ,

I believe this can be done in this manner.
Do 2 separate date histogram on the date_submitted field and date_closed
field.
The sum of count of date_submitted minus the sum of  count on date_closed
on all the previous date should give you the number of open issues for that
week.

For eg:

Week1 - Open - 10 , closed - 5
Week2 - Open 20 m ,closed 6
Week3 - Open 30 , closed 10

Number of open issues on
Week1 - 10
Week2 - (20 + 10 ) - 5 = 25
Week3 -  ( 30 + 20 + 10 ) - (6 + 5) = 49


Thanks
          Vineeth



On Mon, Sep 1, 2014 at 5:25 PM, Simon Edwards <[email protected]>
wrote:

> Hi,
>
> I was wondering if somebody familiar with aggregations, particularly date
> histogram aggregations, can point me in the right direction.
>
> I'm currently looking to get a total count of records over a specific time
> period. Each record contains a "date_submitted" field and if they're
> closed, contain a "date_closed" field.
>
> Is it possible to aggregate the records based off these values (i.e. only
> showing open issues for a weekly period, even if the record was submitted a
> year ago)? If so where abouts are the aggregations specified? In the
> dashboard JSON or within the index mapping?
>
> Many thanks in advance.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/5e448bc2-007b-4c7b-a073-fcb1a8017eed%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/5e448bc2-007b-4c7b-a073-fcb1a8017eed%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5m3oacS75hV6nSeXR0ZasC7RyL2SqDh1vk%2B1VXUKFNd_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to