How to manage the displayed date when weekly time interval is selected?

Hello!

I have weekly Sunday reports and would like to visulize them

I've noticed that when selecting a weekly time interval in any time diagram in Kibana Lens, every bucket displays the first day of the week interval.

For instance, if I am visualing the interval from January 29, 2024 (Monday) to February 4, 2024 (Sunday), it shows 2024-01-29 while hovering a mouse on the bar.

I'm wondering if there's a way to change this behavior. I'd prefer it to display the latest day in the weekly interval, such as 2024-02-04.

Could you please let me know if there's a way to adjust this?

Thank you!

Steps to reproduce:

  1. Create a mapping and dummy docs via Dev Tools representing the case "I have weekly Sunday reports":

    PUT weekly_index
    {
      "mappings": {
    	"properties": {
    	  "@timestamp": {
    		"type": "date"
    	  },
    	  "value": {
    		"type": "double"
    	  }
    	},
    	"runtime": {
    	  "day_of_week": {
    		"type": "keyword",
    		"script": {
    		  "source": "emit(doc['@timestamp'].value.getDayOfWeekEnum().toString())"
    		}
    	  }
    	}
      }
    }
    
    POST weekly_index/_doc
    {
    	"@timestamp": "2024-02-04",
    	"value": "4"
    }
    
    POST weekly_index/_doc
    {
    	"@timestamp": "2024-02-11",
    	"value": "11"
    }
    POST weekly_index/_doc
    {
    	"@timestamp": "2024-02-18",
    	"value": "18"
    }
    POST weekly_index/_doc
    {
    	"@timestamp": "2024-02-25",
    	"value": "25"
    }
    
  2. Create a data view called weekly_index

  3. Create a Lens visualization in Kibana:

    • Set the time interval to the last 2 months
    • Select weekly_index data view
    • Select Bar vertical diagram
    • Drag and drop @timestamp field under Horizontal axes and set its Minimal interval to Day
    • Drag and drop value field under Vertical axes: the Median standard formula should automatically applied
    • Drag and drop day_of_week field under Breakdown

    Here, you have to receive this visulization:

  4. When hovering over a bar, it displays the Sunday date for every bucket, e.g.:

  5. Change @timestamp field's Minimal interval to Week

  6. Now when hovering over a bar, it displays the Monday date for every bucket, e.g.:

  7. I would like it to display the Sunday date again for every bucket, e.g.:

Hi @nnikushkin

there's an advanced setting in Kibana to define what it should be the first day in a week to consider.
It looks like this setting is not picked up correctly by Lens who defaults to Monday. I've opened a ER here.

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