# Adding time range query to one column of a Data table visualization in kibana

**URL:** https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600
**Category:** Kibana
**Created:** [February 8, 2019, 10:01am UTC](https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600 "2019-02-08T10:01:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kalyani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kalyani/32/40717_2.png) [@kalyani](https://discuss.elastic.co/u/kalyani)
#### Post date: [February 8, 2019, 10:01am UTC](https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600/1 "2019-02-08T10:01:21Z")

</div>

Hi,  
I want to display current count and last week's count from a index in a data table visualization in kibana.  
Thinking of using the JSON input advanced option to get count of last week in the table. Not sure how to write a query there. Please help!.

TIA.!

 ![IMG-20190208-WA0009](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7008741040298bdd94f295e6ea721f82f40b60c.jpeg)

---

<div class="post-metadata">

### Author: ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)
#### Post date: [February 8, 2019, 11:18pm UTC](https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600/2 "2019-02-08T23:18:25Z")

</div>

Hi there, you can use the JSON input to [transform the values](https://discuss.elastic.co/t/visualize-json-input-how-to-use/75513) used in that aggregation _after_ the query has been executed, but you can't change the query itself. In other words, it won't allow you to do what you're trying to do. I think the closest you could get is to use Timelion to [perform a series difference calculation](https://rmoff.net/2016/05/23/kibana-timelion-series-calculations-difference-from-one-week-ago/). This will be in the form of a chart, not a table, but it will show difference values based on different points in time.

I hope this helps,  
CJ

---

<div class="post-metadata">

### Author: ![kalyani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kalyani/32/40717_2.png) [@kalyani](https://discuss.elastic.co/u/kalyani)
#### Post date: [February 13, 2019, 11:50am UTC](https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600/3 "2019-02-13T11:50:27Z")

</div>

Hi CJ,  
I was afraid you would say that. Thanks anyway. Will try it the way you suggested.

---

<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: [March 13, 2019, 11:50am UTC](https://discuss.elastic.co/t/adding-time-range-query-to-one-column-of-a-data-table-visualization-in-kibana/167600/4 "2019-03-13T11:50:32Z")

</div>

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