# How to add new column in the datatable

**URL:** <https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172>\
**Category:** Kibana\
**Created:** [July 20, 2022, 2:56pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172 "2022-07-20T14:56:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![malik123](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@malik123](https://discuss.elastic.co/u/malik123)\
**Post date:** [July 20, 2022, 2:56pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/1 "2022-07-20T14:56:55Z")

</div>

Hi all,  
Currently I am working on the sample data that is provided by the kibana.

I want to display a new column in the datatable named "total\_Hours". I want to add "Unique Visits (Total)" and "Unique Visits (Last Hour)" and display that column in the datatable.

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

any help in this regard will be highly appreciated.  
Thank You

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [July 21, 2022, 1:30pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/2 "2022-07-21T13:30:09Z")

</div>

You can't do this in TSVB, but with a Lens datatable and formula it's achievable

---

<div class="post-metadata">

**Author:** ![malik123](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@malik123](https://discuss.elastic.co/u/malik123)\
**Post date:** [July 21, 2022, 1:32pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/3 "2022-07-21T13:32:43Z")

</div>

I am new to kibana..can you please elaborate it in detail.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [July 21, 2022, 1:34pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/4 "2022-07-21T13:34:35Z")

</div>

Check out this guide: [Create visualizations with Lens | Kibana Guide [8.3] | Elastic](https://www.elastic.co/guide/en/kibana/current/lens.html)

Especially the " Use formulas to perform math" section

---

<div class="post-metadata">

**Author:** ![malik123](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@malik123](https://discuss.elastic.co/u/malik123)\
**Post date:** [July 21, 2022, 3:00pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/5 "2022-07-21T15:00:19Z")

</div>

I have reached at that point... now i want to add "Average of bytes" and "Top values of hour\_of\_day", I did not find the way. could you plz guide me regarding this.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/c/ac579dffc08f06f229b8f4bddc4e530257d1aba8.png)

Thank You

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [July 21, 2022, 4:13pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/6 "2022-07-21T16:13:03Z")

</div>

I think your version of Kibana is too old - once you upgrade to a recent version you should be able to create a new metric dimension, then use a formula like `average(bytes) + last_value(hour_of_day)`

---

<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 18, 2022, 4:13pm UTC](https://discuss.elastic.co/t/how-to-add-new-column-in-the-datatable/310172/7 "2022-08-18T16:13:28Z")

</div>

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