# Kibana 4 - Visualization Question

**URL:** https://discuss.elastic.co/t/kibana-4-visualization-question/23102
**Category:** Elasticsearch
**Created:** [April 6, 2015, 3:27am UTC](https://discuss.elastic.co/t/kibana-4-visualization-question/23102 "2015-04-06T03:27:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SD1](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@SD1](https://discuss.elastic.co/u/SD1)
#### Post date: [April 6, 2015, 3:27am UTC](https://discuss.elastic.co/t/kibana-4-visualization-question/23102/1 "2015-04-06T03:27:59Z")

</div>

Hi,

I have a data set which includes the the medal types won by each country  
along with the year they won the medal. Below is the sample data..

"\_source": {

- "message": [
  - "4183,1924-06-01,Summer,"NURMI,  
Paavo",Men,FIN,Finland,Athletics,3000m team,Gold "  
],

- "@version": "1",
- "@timestamp": "2015-04-06T00:19:35.657Z",
- "MedalistID": "4183",
- "Year": "1924-06-01",
- "Season": "Summer",
- "Athlete Name": "NURMI, Paavo",
- "Gender": "Men",
- "NOC": "FIN",
- "Country": "Finland",
- "Main Sport": "Athletics",
- "Detailed Sport": "3000m team",
- "Medal Type": "Gold"

}

I am trying to build the following visualization.

Line Chart:  
Filtered by Top 5 Countries (by count of rows)  
Year on the X Axis  
Count on the Y Axis

\*Find the 5 countries with most medals over entire dataset, then plot their  
results for each year

I am struggling to build this aggregation in Kibana 4. If I first select  
Y-Axis as "Count" and X-Axis as "Terms Aggregation" with Top 5 Country,  
then I can't plot the results per year.

And if I select Y-Axis as "Count" and X-Axis as "Date Histogram" with Year  
and then add a sub-aggregation of "Terms Aggregation" with Top 5 Country,  
then obviously the sub aggregation is per year and not over the entire data  
set. How do I get around this problem.

I want my top level aggregation to be Top 5 Country but the results need to  
be plotted per year.

Thanks,  
Shravanthi

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cdc8ad0a-164b-407b-b19c-1baee10410e4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cdc8ad0a-164b-407b-b19c-1baee10410e4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:21am UTC](https://discuss.elastic.co/t/kibana-4-visualization-question/23102/2 "2017-07-06T00:21:38Z")

</div>


