Dashboards & Visualizations

How to add previous week to line chart for comparison?

davidcraven02
Communicator

I have this below search and would like to add another line to include the week previous showing how it compares with the last 7 days.

index=summary report=otl_engineering_jiracsatresults Key="**" Assignee="**" Classification="**"
 | dedup Key 
 | eval dateEpoch = strptime(Date, "%Y-%m-%d %H:%M") 
 | eval today = now() 
 | eval daysAgo = round(((today - dateEpoch)/60/60/24), 0) 
 | rex field=Date "(?<day>^\d{4}-\d{2}-\d{2}) \d{2}:\d{2}$"
 | table Key, Summary, Reporter, Assignee, Classification, "CSAT Rate", "CSAT Rating Comment", Date, daysAgo, day
 |  search daysAgo <= 7 
 | stats avg("CSAT Rate") as AverageCustomerRating by day
Tags (2)
0 Karma
1 Solution

p_gurav
Champion

Hi try using timewrapcommand at the end of your search with timechart.
Refer: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap

View solution in original post

p_gurav
Champion

Hi try using timewrapcommand at the end of your search with timechart.
Refer: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Timewrap

Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...