<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Add previous week to line chart for comparison in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-previous-week-to-line-chart-for-comparison/m-p/315120#M20221</link>
    <description>&lt;P&gt;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.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;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 "(?&amp;lt;day&amp;gt;^\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 &amp;lt;= 7 
| stats avg("CSAT Rate") as AverageCustomerRating by day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4450i65587FA8D101978B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Feb 2018 09:04:38 GMT</pubDate>
    <dc:creator>davidsplunk123</dc:creator>
    <dc:date>2018-02-28T09:04:38Z</dc:date>
    <item>
      <title>Add previous week to line chart for comparison</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-previous-week-to-line-chart-for-comparison/m-p/315120#M20221</link>
      <description>&lt;P&gt;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.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;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 "(?&amp;lt;day&amp;gt;^\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 &amp;lt;= 7 
| stats avg("CSAT Rate") as AverageCustomerRating by day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4450i65587FA8D101978B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 09:04:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-previous-week-to-line-chart-for-comparison/m-p/315120#M20221</guid>
      <dc:creator>davidsplunk123</dc:creator>
      <dc:date>2018-02-28T09:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add previous week to line chart for comparison</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Add-previous-week-to-line-chart-for-comparison/m-p/315121#M20222</link>
      <description>&lt;P&gt;what version of Splunk are you using? newer versions of Splunk (6.5+, I believe) have a command called &lt;CODE&gt;timewrap&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Timewrap"&gt;https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Timewrap&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;if you do something ilke:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;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 "(?&amp;lt;day&amp;gt;^\d{4}-\d{2}-\d{2}) \d{2}:\d{2}$"
 | table Key, Summary, Reporter, Assignee, Classification, "CSAT Rate", "CSAT Rating Comment", Date, daysAgo, day dateEpoch
 | eval _time=dateEpoch
 |  search daysAgo &amp;lt;= 14 
 | timechart span=1d avg("CSAT Rate") as AverageCustomerRating 
 | timewrap 1week
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;there is also a timewrap app, if you're on an older version of splunk &lt;A href="https://splunkbase.splunk.com/app/1645/"&gt;https://splunkbase.splunk.com/app/1645/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2018 12:53:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Add-previous-week-to-line-chart-for-comparison/m-p/315121#M20222</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-02-28T12:53:19Z</dc:date>
    </item>
  </channel>
</rss>

