<?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: Diff and % calculation 1st row vs 2nd row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241841#M176209</link>
    <description>&lt;P&gt;thanks a lot&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2016 12:28:45 GMT</pubDate>
    <dc:creator>puneethgowda</dc:creator>
    <dc:date>2016-11-18T12:28:45Z</dc:date>
    <item>
      <title>Diff and % calculation 1st row vs 2nd row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241838#M176206</link>
      <description>&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/174245-capture.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;source=DAM_DB_SUMMARY_REPORT | eval Date=substr(DATES,1,10) | stats sum(TOTAL_RECORDS) as "Total Records"  by Date | sort - Date&lt;/P&gt;

&lt;P&gt;i would like to insert one column that should be DIFF and calculation should be subtraction ( Row 1 - row 2) row 1 value us 797,775 and row 2 value is 797,774 so 3rd new column value should be 1. and also we need % in 3rd column 1/797,775 (diff/1st row count)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:53:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241838#M176206</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2020-09-29T11:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Diff and % calculation 1st row vs 2nd row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241839#M176207</link>
      <description>&lt;P&gt;I thought this for sure was going to be a &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Streamstats"&gt;streamstats&lt;/A&gt; answer, but instead it's far easier to use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Delta"&gt;delta&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;You should be able to just add &lt;CODE&gt;| delta "Total Records"&lt;/CODE&gt; to the end of your search, like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=DAM_DB_SUMMARY_REPORT | eval Date=substr(DATES,1,10) | stats sum(TOTAL_RECORDS) as "Total Records" by Date | sort - Date | delta "Total Records"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you give that a go and report back?&lt;/P&gt;

&lt;P&gt;Happy Splunking!&lt;BR /&gt;
Rich&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 12:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241839#M176207</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-11-18T12:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Diff and % calculation 1st row vs 2nd row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241840#M176208</link>
      <description>&lt;P&gt;sorry it was very simple i have got this after posting here  forgot to upfdate&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 12:27:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241840#M176208</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2016-11-18T12:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Diff and % calculation 1st row vs 2nd row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241841#M176209</link>
      <description>&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 12:28:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Diff-and-calculation-1st-row-vs-2nd-row/m-p/241841#M176209</guid>
      <dc:creator>puneethgowda</dc:creator>
      <dc:date>2016-11-18T12:28:45Z</dc:date>
    </item>
  </channel>
</rss>

