# How to apply a transformation after an aggregation has been calculated

**URL:** https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294
**Category:** Kibana
**Created:** [July 1, 2019, 11:00am UTC](https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294 "2019-07-01T11:00:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ady\_Sevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ady_sevy/32/49155_2.png) [@Ady\_Sevy](https://discuss.elastic.co/u/Ady_Sevy)
#### Post date: [July 1, 2019, 11:00am UTC](https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294/1 "2019-07-01T11:00:57Z")

</div>

We're using Kibana 6.7.1

I have a timestamp field that is stored in UTC.  
I'm calculating the max of it so I can get the last object received timestamp.

I want to be able to convert that into Eastern time AFTER the aggregation has been calculated.  
So either minus 5 hours (EST) or minus 4 hours (EDT) from the timestamp I have.

How do I do that when creating a visualization? Can I use theJSON input to achieve that?

---

<div class="post-metadata">

### Author: ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)
#### Post date: [July 1, 2019, 2:42pm UTC](https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294/2 "2019-07-01T14:42:33Z")

</div>

@Ady_Sevy,

Is this one specific visualization going to behave differently from the rest of your visualizations in Kibana? If not, you can specify your preferred timezone under Kibana's advanced settings. Kibana should automatically convert timestamps to your preferred timezone this way.

The default behavior is to use the browser's timezone, but you can change this to a fixed EST/EDT if you'd prefer:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2e4ec75c7f6d1e09e7c2fab44bc7e34215488b4a.png)

Otherwise, you could use a scripted field to do the conversion _before_ the aggregation, but there's currently no way to transform this in Kibana after aggregation if the timezone setting doesn't work for you

---

<div class="post-metadata">

### Author: ![Ady\_Sevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ady_sevy/32/49155_2.png) [@Ady\_Sevy](https://discuss.elastic.co/u/Ady_Sevy)
#### Post date: [July 2, 2019, 1:18pm UTC](https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294/3 "2019-07-02T13:18:43Z")

</div>

Thank you!

The browser date is the perfect solution.

---

<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 30, 2019, 1:18pm UTC](https://discuss.elastic.co/t/how-to-apply-a-transformation-after-an-aggregation-has-been-calculated/188294/4 "2019-07-30T13:18:53Z")

</div>

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