# Problem with Date Histogram when having multiple date fields in Index-Patter

**URL:** <https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789>\
**Category:** Kibana\
**Created:** [April 8, 2019, 8:13am UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789 "2019-04-08T08:13:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![V.krae](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@V.krae](https://discuss.elastic.co/u/V.krae)\
**Post date:** [April 8, 2019, 8:13am UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789/1 "2019-04-08T08:13:24Z")

</div>

Hi everyone,

I am new to elastic and Kibana and encountered a problem with the Date Histograms in Kibana.

 ![DateFields](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b2412605e4c2902eb34ba46ce7dce633ae9bb663.png)

I have two indices with multiple date type fields. On one Index I have the field "date" and on the other the fields "lastLogin" and "firstLogin". When I create an Index-Pattern and choose eg. "lastLogin" as Time-Filter, only the Date Histogram for "lastLogin" is correct.

 ![LastLogin1Year](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85a85e9bdf52774ca52ec968a56883ff19cf1dec.png)

In the case of "firstLogin" the Graph seems to be right and also changes when I change the Time Picker Range, but the Label of the X-Axis does not change and stays the same all the time.

 ![FirstLogin1Year](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01762c97019b9c28f8c74a1e8129b0aeaacc753e.png)  
 ![FirstLogins2Years](https://us1.discourse-cdn.com/elastic/original/3X/9/1/917d7a4fa21ee4232a5e2648f1c7ab4a1ec0e5d9.png)

In the other case of "date", I simply get the message that no results were found.

 ![date](https://us1.discourse-cdn.com/elastic/original/3X/a/f/aff29b61e9ab343924579a34e0610ccbe1cc1a78.png)

I made sure, that the date format is the same in all three cases. All fields have the format YYYY-mm-ddTHH:mm:ss.  
For the import of the data I am using the NEST API for C# and the data originates from a MySQL database.

Does anyone has an idea what I am doing wrong and how to get this fixed?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [April 8, 2019, 8:37pm UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789/2 "2019-04-08T20:37:28Z")

</div>

It looks like some confusion is happening, since the index pattern has 3 date type fields.

Setting a date field for an index pattern, all it means is: when you use the time picker on the top right, Kibana will `apply the bounds of that filter to the field you picked for your date field`.

In your first screenshot, I see a date histogram for first logins, `for all records where ``date`` is within ``Last 1 year```

If `date` and `firstLogin / lastLogin` aren't related data, then they should not be used in combination.

---

<div class="post-metadata">

**Author:** ![V.krae](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@V.krae](https://discuss.elastic.co/u/V.krae)\
**Post date:** [April 9, 2019, 5:43am UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789/3 "2019-04-09T05:43:36Z")

</div>

First thank you for your answer!

I dont really want to use them in combination. I just want to have working Date Histograms for all three fields and I dont really understand why as example there are no results found for the 'date' field.

EDIT: I think I misunderstood the point ypou were making! Now I figured at what point I got the wrong idea how the filter system works. Thanks again!

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [April 9, 2019, 6:06pm UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789/4 "2019-04-09T18:06:38Z")

</div>

Glad you got it working!

I was going to suggest you can also look in the Discover app to check the values of your documents and make sure they're what you think they should be.

---

<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:** [May 7, 2019, 6:06pm UTC](https://discuss.elastic.co/t/problem-with-date-histogram-when-having-multiple-date-fields-in-index-patter/175789/5 "2019-05-07T18:06:44Z")

</div>

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