# Creating Charts from Only the latest data for a term

**URL:** <https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392>\
**Category:** Kibana\
**Created:** [July 8, 2019, 5:09pm UTC](https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392 "2019-07-08T17:09:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david-cunningham-rez](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@david-cunningham-rez](https://discuss.elastic.co/u/david-cunningham-rez)\
**Post date:** [July 8, 2019, 5:09pm UTC](https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392/1 "2019-07-08T17:09:38Z")

</div>

Hello, so I'm looking to create a chart that gives me the percentage of projects matching a filter.

However, my employer only wants the latest entry for a given application to be used in the chart.

Is there an ideal way to take care of this, or is this simply not possible in kibana?

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [July 8, 2019, 5:34pm UTC](https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392/2 "2019-07-08T17:34:41Z")

</div>

Can you provide a little bit more information?

- What is the schema/mappings of your data?
- What would you like the resulting visualization to look like? An example would help

With a bit more info, we can provide more guidance.

Thanks!

---

<div class="post-metadata">

**Author:** ![david-cunningham-rez](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@david-cunningham-rez](https://discuss.elastic.co/u/david-cunningham-rez)\
**Post date:** [July 8, 2019, 5:42pm UTC](https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392/3 "2019-07-08T17:42:49Z")

</div>

So here are really the relevant fields simplified a little bit:

{  
active: true,  
applicationName: "Project A"  
submissionDate: "2019-07-08"  
}

There's also similar entries for project A, B, C, D ect. These entries documents have an active of true or false, and a submission date from when this information was gathered.

So lets say I wanted to create a pie chart displaying the percentage of my charts that are currently active (the document for project A with the latest submission date where active=true). So I would have a single document per application that shows whether it's currently active or not as my data set. I want to find display the percentage of those projects that are active compared to the entire data set.

So the example would be a pie chart that's showing the percentage of active applications, but it's only using the latest entry for a given application in its data set. Does that make a little more sense now?

---

<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:** [August 5, 2019, 5:42pm UTC](https://discuss.elastic.co/t/creating-charts-from-only-the-latest-data-for-a-term/189392/4 "2019-08-05T17:42:52Z")

</div>

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