# Creating data table using group by like clause in Kibana?

**URL:** https://discuss.elastic.co/t/creating-data-table-using-group-by-like-clause-in-kibana/63352
**Category:** Kibana
**Created:** [October 19, 2016, 7:58am UTC](https://discuss.elastic.co/t/creating-data-table-using-group-by-like-clause-in-kibana/63352 "2016-10-19T07:58:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)
#### Post date: [October 19, 2016, 7:58am UTC](https://discuss.elastic.co/t/creating-data-table-using-group-by-like-clause-in-kibana/63352/1 "2016-10-19T07:58:02Z")

</div>

I'm having a dataset fed from my database into an index which I created using `logstash`. I'm trying to create a `table data` visualization through `Kibana` for the data set available.

I've got to create a `table data` in `Kibana` which should look more a like this.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/fc5304544631baddb99df0c56b040680703d071d.png)

In the above image I could simply get the date and the month seperately. The next column (num of Txn) is an aggregation from a `groupby` which contains the total hits of a particular `userid`, a `string` value. The other columns, (Gross Transaction Val) is a sum of a field (chargeamount) which is a `string` value and the other columns are `response code counts` for a particular `userid` in db.

I tried creating the table using `metrics` and `buckets`, but couldn't get it done completely. These are some snapshots of what I tried:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/cbdea1f16a34e056a113010fdc00386fd42f652a.png)

The sub buckets:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/f/ffdd2c134f4225c73b288d4ef7b4195f8803d908.png)

**These are the issues:**

1. I'm having a date and month fields separately. But is it possible to append both of them together in `Kibana`?
2. How can I get a  
`count metric` being applied to a `String` value? Is there a way  
that I could convert it to `int` through `Kibana`?
3. Is `groupby` clause in `MySQL` equal to aggregation buckets in  
`Kibana`?

Where am I going wrong? Any help could be appreciated.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [October 19, 2016, 8:02pm UTC](https://discuss.elastic.co/t/creating-data-table-using-group-by-like-clause-in-kibana/63352/2 "2016-10-19T20:02:25Z")

</div>

Unfortunately, the data table visualization isn't going to get you the same table you have in your example.

In the data table visualization, think of the rows as buckets, and the columns as metrics calculated on the buckets. So the closest I think you could get to recreating your desired table is to select a date histogram bucket aggregation with a daily interval. Then, you can add metrics, like count, sum chargeamount, etc. Unfortunately you won't be able to have separate group by metrics as columns, because those are counts of separate buckets. You could then add a second bucket aggregation and split rows by response code, but then you'd have different rows when what you really want is separate columns.

---

<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, 1:36pm UTC](https://discuss.elastic.co/t/creating-data-table-using-group-by-like-clause-in-kibana/63352/3 "2017-07-06T13:36:14Z")

</div>


