<?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 to calculate percent increase of crime by month over 6 years? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325512#M97065</link>
    <description>&lt;P&gt;Thank you! There was an error with the eval command but I was able to fix it and I also added:&lt;/P&gt;

&lt;P&gt;| fieldformat Percent=tostring(Percent) + "%" &lt;/P&gt;

&lt;P&gt;to format "Percent". &lt;/P&gt;</description>
    <pubDate>Sat, 25 Feb 2017 03:13:56 GMT</pubDate>
    <dc:creator>KassandraI</dc:creator>
    <dc:date>2017-02-25T03:13:56Z</dc:date>
    <item>
      <title>How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325510#M97063</link>
      <description>&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/2545i4A242F57D77103CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Hello, I'm new to Splunk and would appreciate any help. &lt;BR /&gt;
I am trying to figure out what month had the largest percent increase in crime from 2011-2017. &lt;BR /&gt;
I was able to list all the values out and add the totals but I'm not sure where to go from here.&lt;/P&gt;

&lt;P&gt;Thank you for you help.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2017 01:16:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325510#M97063</guid>
      <dc:creator>KassandraI</dc:creator>
      <dc:date>2017-02-25T01:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325511#M97064</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=csv | stats count by date_month date_year 
| appendpipe [| stats first(count) as from last(count) as to by date_month | eval count=round(to-from)*100/from,2) | eval date_year="PercentChange"| table date_month date_year count] 
| appendpipe [| stats sum(count) as count by date_month | eval date_year="Total"| table date_month date_year count] 
| xyseries date_month date_year count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first line get count in following format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month, date_year, count
april, 2011, xxx
...
april,2017,yyy
..other months say way 2011 to 2017...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first appendpipe takes the first count (for 2011) and last count (for 2017) and calculates % change. The column names are adjusted to follow the output of first line (date_month, date_year as label percent and count as percent value). Output of this is added to the end of the output so far.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date_month, date_year, count
..above output..
april, percentchange,zzzz
..similarly for other months...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second appendpipe is to calculate total for the month. The columns names are again formatted to match the output of first line (date_month, date_year as label Total and count as total value). Output of this is added to the end of the output so far.&lt;/P&gt;

&lt;P&gt;The xyseries will give output similar to chart command, where all date_month will come as row, all date_year values as column, include PercentChange and Total, and corresponding values will be populated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325511#M97064</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T12:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325512#M97065</link>
      <description>&lt;P&gt;Thank you! There was an error with the eval command but I was able to fix it and I also added:&lt;/P&gt;

&lt;P&gt;| fieldformat Percent=tostring(Percent) + "%" &lt;/P&gt;

&lt;P&gt;to format "Percent". &lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2017 03:13:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325512#M97065</guid>
      <dc:creator>KassandraI</dc:creator>
      <dc:date>2017-02-25T03:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325513#M97066</link>
      <description>&lt;P&gt;hello, &lt;/P&gt;

&lt;P&gt;@Kassandral, could you please tell my how do you fixe the Eval error ? &lt;/P&gt;

&lt;P&gt;Thanks a lot,&lt;/P&gt;

&lt;P&gt;Romain &lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 14:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325513#M97066</guid>
      <dc:creator>rflouquet</dc:creator>
      <dc:date>2017-04-03T14:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325514#M97067</link>
      <description>&lt;P&gt;The eval is missing an open parenthesis...&lt;/P&gt;

&lt;P&gt;| eval count=round((to-from)*100/from,2) &lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325514#M97067</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-03T17:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate percent increase of crime by month over 6 years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325515#M97068</link>
      <description>&lt;P&gt;hey somesoni2&lt;BR /&gt;
 in the second appendpipe, when you calculate the totals, I think you are also including the figures from the first appendpipe, and then the final figure is wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 09:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-percent-increase-of-crime-by-month-over-6-years/m-p/325515#M97068</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2017-04-04T09:28:04Z</dc:date>
    </item>
  </channel>
</rss>

