<?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: Calculate Standard Deviation for a table in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321935#M20708</link>
    <description>&lt;P&gt;@ashish9433, maybe you can add your working query and accept the same as answer so that others needing the same/similar use case may get benefited.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 17:08:35 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-12-06T17:08:35Z</dc:date>
    <item>
      <title>Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321932#M20705</link>
      <description>&lt;P&gt;I have a table which is in below format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Time         ProcessTime1                           ProcessTime2                  ABC_Count
11/14/2017    100                                     112                             30000    
11/15/2017    118                                     205                             30546
11/16/2017    119                                     121                             43000
11/17/2017    141                                     192                             95000     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It produces a visualization like below, where ABC_Count is the overlay which is the red line in the below graph.&lt;/P&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/3956i61A297F8751F1DF7/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;I want to have stdev plotted in the below graph, and if run the below search query it is giving me zero as stdev&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mybase search | stats values(ProcessTime1), values(ProcessTime2), values(ABC_Count), stdev(ProcessTime1), stdev(ProcessTime2) by Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically if just remove the "by Time" in the above search i get stdev calculated properly, but then the visualization is not available.&lt;/P&gt;

&lt;P&gt;Any idea how stdev can be plotted in the same graph?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 10:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321932#M20705</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-12-06T10:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321933#M20706</link>
      <description>&lt;P&gt;If I understand your question correctly, the standard deviation for each field will just be a single value. So do you want to plot a flat line across the whole bar chart to show the standard deviation? Or were you hoping to plot the new standard deviation from all past records as you include each new day of data?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 11:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321933#M20706</guid>
      <dc:creator>alistairmcdouga</dc:creator>
      <dc:date>2017-12-06T11:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321934#M20707</link>
      <description>&lt;P&gt;I was looking to plot a single line of standard deviation. Basically i was trying using stats command, but later i used streamstats command and i was able to address what i was looking for.&lt;/P&gt;

&lt;P&gt;Thanks for your revert @alistairmcdougall &lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:33:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321934#M20707</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-12-06T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321935#M20708</link>
      <description>&lt;P&gt;@ashish9433, maybe you can add your working query and accept the same as answer so that others needing the same/similar use case may get benefited.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 17:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321935#M20708</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-06T17:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321936#M20709</link>
      <description>&lt;P&gt;Sounds like you were looking for a running &lt;CODE&gt;avg()&lt;/CODE&gt; and running &lt;CODE&gt;stdev()&lt;/CODE&gt; or something.  Please post what you ended up with, so that later searchers can find it.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 22:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321936#M20709</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-06T22:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321937#M20710</link>
      <description>&lt;P&gt;@DalJeanis You are correct, i was looking for running stdev(), but was not able to find out how to do that, so ended up with a straight line of stdev.&lt;/P&gt;

&lt;P&gt;Do you have any idea how can we get running stdev() plotted for the above scenario?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 04:05:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321937#M20710</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-12-07T04:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321938#M20711</link>
      <description>&lt;P&gt;@ashish9433, you can check out &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Trendline"&gt;Trendline&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Autoregress"&gt;autoregress&lt;/A&gt; commands for &lt;CODE&gt;moving averages&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You should also check out &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/Detectinganomalies"&gt;Splunk documentation on Advanced Statistics&lt;/A&gt; if your end goal is identifying anomalies and outliers.&lt;BR /&gt;
Finally do check out &lt;A href="https://splunkbase.splunk.com/app/2890/"&gt;Splunk's Machine Learning Toolkit app (MLTK)&lt;/A&gt; for identifying numerical and categorical outliers. Numerical outliers have examples of &lt;CODE&gt;Interquartile Range&lt;/CODE&gt;, &lt;CODE&gt;Mean Absolute Deviation&lt;/CODE&gt; and &lt;CODE&gt;Standard Deviation&lt;/CODE&gt; using &lt;CODE&gt;streamstats&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 04:52:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321938#M20711</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-07T04:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321939#M20712</link>
      <description>&lt;P&gt;As indicated in the comments, the above can be calculated used the streamstats function. Make sure you time is in ascending order, and then use streamstats to apply the stdev function on the fields you want to calculate the running stdev for (the same method applies for any other running aggregates, e.g. mean).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats stdev(ProcessTime1) AS stdev_ProcessTime1, stdev(ProcessTime2) AS stdev_ProcessTime2
| stats values(ProcessTime1), values(stdev_ProcessTime1), values(ProcessTime2), values(stdev_ProcessTime2), values(ABC_Count) BY Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2017 09:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/321939#M20712</guid>
      <dc:creator>alistairmcdouga</dc:creator>
      <dc:date>2017-12-07T09:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Standard Deviation for a table</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/569600#M46794</link>
      <description>&lt;P&gt;with stats i was able to get the result of a tabular data in a single row, however with streamstats the stats are applied consecutively to the aggregated data on a per row level, basically aggregates fields and the applies the stats until that row and appends the stats fields to that row. Good to know, but did not help.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 19:16:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-Standard-Deviation-for-a-table/m-p/569600#M46794</guid>
      <dc:creator>dresh</dc:creator>
      <dc:date>2021-10-04T19:16:37Z</dc:date>
    </item>
  </channel>
</rss>

