<?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 Re: How can I add a column at the end that shows the difference between the two weeks? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598714#M208479</link>
    <description>&lt;P&gt;Worked perfect, thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2022 19:14:52 GMT</pubDate>
    <dc:creator>JoeHubner</dc:creator>
    <dc:date>2022-05-20T19:14:52Z</dc:date>
    <item>
      <title>How can I add a column at the end that shows the difference between the two weeks?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598711#M208477</link>
      <description>&lt;P&gt;I would like to add a column to a chart that is the difference of the two columns before it in an application where I am showing the Cost for each employee for the last 2 weeks.&amp;nbsp; &amp;nbsp;Using the search:&lt;/P&gt;
&lt;P&gt;index=SampleData&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| where _time&amp;gt;relative_time(now(),"-2w@w")&lt;/P&gt;
&lt;P&gt;| convert timeformat="%m-%d-%Y" ctime(_time)&lt;/P&gt;
&lt;P&gt;| chart sum(Cost) over Employee by _time&lt;/P&gt;
&lt;P&gt;The above produces a chart that looks like the following&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Employee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05-08-2022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05-15-2022&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Employee1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100.00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 150.00&lt;BR /&gt;Employee2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200.00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 175.00&lt;/P&gt;
&lt;P&gt;How can I add a column at the end that shows the difference between the two weeks?&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 19:03:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598711#M208477</guid>
      <dc:creator>JoeHubner</dc:creator>
      <dc:date>2022-05-20T19:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I add a column at the end that shows the difference between the two weeks?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598712#M208478</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=SampleData 
| where _time&amp;gt;relative_time(now(),"-2w@w")
| convert timeformat="%m-%d-%Y" ctime(_time)
| chart sum(Cost) over Employee by _time
| eval diff=-1
| foreach 0* 1* [| eval diff=if(diff=-1,'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;','&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'-diff)]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 May 2022 19:10:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598712#M208478</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-05-20T19:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I add a column at the end that shows the difference between the two weeks?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598714#M208479</link>
      <description>&lt;P&gt;Worked perfect, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 19:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-add-a-column-at-the-end-that-shows-the-difference/m-p/598714#M208479</guid>
      <dc:creator>JoeHubner</dc:creator>
      <dc:date>2022-05-20T19:14:52Z</dc:date>
    </item>
  </channel>
</rss>

