<?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: Using stats Min and Max commands inside a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74439#M18771</link>
    <description>&lt;P&gt;That works perfectly. Thank you very much!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2013 07:30:31 GMT</pubDate>
    <dc:creator>omend</dc:creator>
    <dc:date>2013-06-25T07:30:31Z</dc:date>
    <item>
      <title>Using stats Min and Max commands inside a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74437#M18769</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have inserted my raw data into Splunk. The data contains many records on sales statistics of different store branches. The data is in a format of "Date" "Branch_ID" "Sales in USD".&lt;/P&gt;

&lt;P&gt;I would like to calculate "Score" for each of these records. For simplicity, Lets assume the Score function operates like this - For each record (that stands for one branch sales on a specific date), I would like to normalize the sales number by subtracting the minimal value of this branch sales across history, and divide it by the range of the sales across history (range as the difference between the max and min values).&lt;/P&gt;

&lt;P&gt;i.e per record, Score = (Sales - min(All sales values of this branch)) / Range(All sales values of this branch)&lt;/P&gt;

&lt;P&gt;Could someone help me with a snippet of this kind of query?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ori.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 04:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74437#M18769</guid>
      <dc:creator>omend</dc:creator>
      <dc:date>2013-06-25T04:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using stats Min and Max commands inside a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74438#M18770</link>
      <description>&lt;P&gt;You could probably use &lt;CODE&gt;eventstats&lt;/CODE&gt; and &lt;CODE&gt;eval&lt;/CODE&gt; for creating the stats and then performing your calculations.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eventstats min(Sales) as minSales, range(Sales) as rangeSales | eval Score = (Sales-minSales)/rangeSales
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2013 06:07:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74438#M18770</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-06-25T06:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using stats Min and Max commands inside a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74439#M18771</link>
      <description>&lt;P&gt;That works perfectly. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 07:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-stats-Min-and-Max-commands-inside-a-search/m-p/74439#M18771</guid>
      <dc:creator>omend</dc:creator>
      <dc:date>2013-06-25T07:30:31Z</dc:date>
    </item>
  </channel>
</rss>

