# Line graph in 5 min interval showing previous values

**URL:** <https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868>\
**Category:** Kibana\
**Tags:** lens\
**Created:** [August 29, 2023, 8:41am UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868 "2023-08-29T08:41:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saili\_Bakalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saili_bakalkar/32/124924_2.png) [@Saili\_Bakalkar](https://discuss.elastic.co/u/Saili_Bakalkar)\
**Post date:** [August 29, 2023, 8:41am UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/1 "2023-08-29T08:41:51Z")

</div>

Value Time  
6.55 2023-08-24 18:08:00  
6.49 2023-08-24 18:11:40  
6.50 2023-08-24 18:13:30

I have a line graph of value vs time with minimum interval set to 5m I want to create a 5 min window of this data so when when the graph is created it shows at 18:05:00 the value as 6.55 whereas this value came after…at 18:08:00 similarly on 18:10:00 it shows 6.49 where my value occurred at 18:11:40….so things are going wrong how can i fix this…

Basically my requirement is that 6.55 should appear at 18:10 and not 18:05..wat changes will be needed?

as shown in below image there should not be any value at 18:05  
and at 18:10 it should show 6.49

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/9/0931d335f92607109c293c45d2229c2cd7a6c645.jpeg)

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 29, 2023, 9:21am UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/2 "2023-08-29T09:21:24Z")

</div>

Hi @Saili_Bakalkar

welcome to the Kibana community.

> Basically my requirement is that 6.55 should appear at 18:10 and not 18:05..wat changes will be needed?

In Kibana Lens each date histogram bucket has the label shown at the beginning of the bucket: the interval between 18:05 and 18:10 will be identified as `18:05`.  
Therefore the 6.55 value is shown for the date histogram bucket that starts at 18:05 and ends at 18:10, which is correct as from my understanding it happened at 18:08.

---

<div class="post-metadata">

**Author:** ![Saili\_Bakalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saili_bakalkar/32/124924_2.png) [@Saili\_Bakalkar](https://discuss.elastic.co/u/Saili_Bakalkar)\
**Post date:** [August 29, 2023, 12:10pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/3 "2023-08-29T12:10:39Z")

</div>

But at business level it is wrong as for them its like if no value was existing at 18.05 than the value should appear at 18.10 is there any way I can achieve this? Thats a critical business requirement...

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 29, 2023, 12:23pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/4 "2023-08-29T12:23:52Z")

</div>

Can you check the raw response from ES?

On the editor there's the `Inspect` button on the top right, then switch from `View: Data` to `View: Request` and check the `Response` tab.

---

<div class="post-metadata">

**Author:** ![Saili\_Bakalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saili_bakalkar/32/124924_2.png) [@Saili\_Bakalkar](https://discuss.elastic.co/u/Saili_Bakalkar)\
**Post date:** [August 29, 2023, 12:40pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/5 "2023-08-29T12:40:56Z")

</div>

```auto
{
  "id": "FkczQ256NzhUU182Z2UwRFAxYW5DbHcdc3djc08xQ05UUWVEZE96MEN6eV9Ddzo2NjI5MDU=",
  "rawResponse": {
    "took": 657,
    "timed_out": false,
    "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "total": 3,
      "max_score": null,
      "hits": []
    },
    "aggregations": {
      "0": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
          {
            "1": {
              "buckets": [
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:30:00.000+05:30",
                  "key": 1692878400000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:35:00.000+05:30",
                  "key": 1692878700000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:40:00.000+05:30",
                  "key": 1692879000000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:45:00.000+05:30",
                  "key": 1692879300000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:50:00.000+05:30",
                  "key": 1692879600000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T17:55:00.000+05:30",
                  "key": 1692879900000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T18:00:00.000+05:30",
                  "key": 1692880200000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": 6.550000190734863
                    }
                  },
                  "key_as_string": "2023-08-24T18:05:00.000+05:30",
                  "key": 1692880500000,
                  "doc_count": 1
                },
                {
                  "2": {
                    "values": {
                      "50.0": 6.494999885559082
                    }
                  },
                  "key_as_string": "2023-08-24T18:10:00.000+05:30",
                  "key": 1692880800000,
                  "doc_count": 2
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T18:15:00.000+05:30",
                  "key": 1692881100000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T18:20:00.000+05:30",
                  "key": 1692881400000,
                  "doc_count": 0
                },
                {

                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T18:25:00.000+05:30",
                  "key": 1692881700000,
                  "doc_count": 0
                },
                {
                  "2": {
                    "values": {
                      "50.0": null
                    }
                  },
                  "key_as_string": "2023-08-24T18:30:00.000+05:30",
                  "key": 1692882000000,
                  "doc_count": 0
                }
              ]
            },
            "2": {
              "values": {
                "50.0": 6.5
              }
            },
            "key": "CALL",
            "doc_count": 3
          }
        ]
      }
    }
  },
  "isPartial": false,
  "isRunning": false,
  "total": 1,
  "loaded": 1,
  "isRestored": true
}

```

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 29, 2023, 12:57pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/6 "2023-08-29T12:57:12Z")

</div>

So the response from ES is actually reporting that value for the 18:05 bucket:

```auto
{
                  "2": {
                    "values": {
                      "50.0": 6.550000190734863
                    }
                  },
                  "key_as_string": "2023-08-24T18:05:00.000+05:30",
                  "key": 1692880500000,
                  "doc_count": 1
                },

```

If you see the same data in Discover, do you seen anything between 18:00 and 18:05?

---

<div class="post-metadata">

**Author:** ![Saili\_Bakalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saili_bakalkar/32/124924_2.png) [@Saili\_Bakalkar](https://discuss.elastic.co/u/Saili_Bakalkar)\
**Post date:** [August 29, 2023, 1:02pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/7 "2023-08-29T13:02:38Z")

</div>

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

There is nothing in the 18:00 and 18:05 bucket

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [August 29, 2023, 3:30pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/8 "2023-08-29T15:30:17Z")

</div>

Can you extend the time range in Discover and check? I see the `@timestamp` field which is probably the default time field for the dataView, I guess, and that might filter out some `trade_timestamp` values.

---

<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:** [September 26, 2023, 3:30pm UTC](https://discuss.elastic.co/t/line-graph-in-5-min-interval-showing-previous-values/341868/9 "2023-09-26T15:30:57Z")

</div>

Closed on September 26, 2023, 3:30pm UTC

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