# Grouped country wise channel id in first index the next index having each row in channel id i want to sum the next index record but i dont know how to use

**URL:** <https://discuss.elastic.co/t/grouped-country-wise-channel-id-in-first-index-the-next-index-having-each-row-in-channel-id-i-want-to-sum-the-next-index-record-but-i-dont-know-how-to-use/230282>\
**Category:** Elasticsearch\
**Created:** [April 29, 2020, 1:53am UTC](https://discuss.elastic.co/t/grouped-country-wise-channel-id-in-first-index-the-next-index-having-each-row-in-channel-id-i-want-to-sum-the-next-index-record-but-i-dont-know-how-to-use/230282 "2020-04-29T01:53:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh\_Kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramesh_kumar/32/66841_2.png) [@Ramesh\_Kumar](https://discuss.elastic.co/u/Ramesh_Kumar)\
**Post date:** [April 29, 2020, 1:53am UTC](https://discuss.elastic.co/t/grouped-country-wise-channel-id-in-first-index-the-next-index-having-each-row-in-channel-id-i-want-to-sum-the-next-index-record-but-i-dont-know-how-to-use/230282/1 "2020-04-29T01:53:56Z")

</div>

{

```
"aggs" : {
    "country_groups" : {
        "terms" : { "field" : "country.keyword",
        		"size":30000
        },
        "aggs": {
            "channel_ids": {
                "terms": { "field" : "channel_id.keyword", 
                		"size":30000
                }
            }
        }
    }
}

```

}

---

<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:** [May 27, 2020, 8:55am UTC](https://discuss.elastic.co/t/grouped-country-wise-channel-id-in-first-index-the-next-index-having-each-row-in-channel-id-i-want-to-sum-the-next-index-record-but-i-dont-know-how-to-use/230282/2 "2020-05-27T08:55:06Z")

</div>

Closed on May 27, 2020, 8:55am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
