<?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: Getting cumulative total into chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350295#M175204</link>
    <description>&lt;P&gt;Just add the following to your existing query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Your exiting Search with chart as base search&amp;gt;
| accum LAW as Cumu_LAW 
| accum BUSINESS as Cumu_BUSINESS  
| accum EDUCATION as Cumu_EDUCATION 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you need to enable Chart Overlay  for all Cumu_* fields and View as Axis should be turned on. You can do the same by editing the Visualization in Splunk Web UI or else through Splunk CHart reference&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;charting.chart.overlayfields&amp;gt;Cumu_LAW ,Cumu_BUSINESS,Cumu_EDUCATION&amp;lt;/charting.chart.overlayfields&amp;gt;
&amp;lt;charting.Y2.enabled&amp;gt;1&amp;lt;/charting.Y2.enabled&amp;gt;
&amp;lt;charting.Y2.scale&amp;gt;linear&amp;lt;/charting.Y2.scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Mar 2017 13:11:39 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-03-10T13:11:39Z</dc:date>
    <item>
      <title>Getting cumulative total into chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350294#M175203</link>
      <description>&lt;P&gt;I have a dataset like:&lt;/P&gt;

&lt;P&gt;quarter,faculty, people&lt;BR /&gt;
2016-Q1,LAW,2&lt;BR /&gt;
2016-Q1,BUSINESS,11&lt;BR /&gt;
2016-Q1,EDUCATION,2&lt;BR /&gt;
2016-Q2,BUSINESS,11&lt;BR /&gt;
2016-Q2,BUSINESS,7&lt;BR /&gt;
2017-Q1,LAW,5&lt;BR /&gt;
2017-Q1,LAW,1&lt;BR /&gt;
2017-Q1,EDUCATION,3&lt;BR /&gt;
2017-Q1,EDUCATION,4&lt;BR /&gt;
2017-Q1,EDUCATION,2&lt;/P&gt;

&lt;P&gt;I'm trying to get the cumulative total by quarter of people per faculty&lt;/P&gt;

&lt;P&gt;And display this in a chart so that the people count is on the y axis, the quarter is on the x-axis and the graph is stacked by faculty.&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;I can get the (summed) people count as a chart, by doing this:&lt;/P&gt;

&lt;P&gt;search |  chart sum(people) over quarter by faculty&lt;/P&gt;

&lt;P&gt;So the data would look like:&lt;/P&gt;

&lt;P&gt;2016-Q1&lt;BR /&gt;
LAW = 2&lt;BR /&gt;
BUSINESS = 11&lt;BR /&gt;
EDUCATION = 2&lt;/P&gt;

&lt;P&gt;2016-Q2&lt;BR /&gt;
LAW = 0&lt;BR /&gt;
BUSINESS = 18&lt;BR /&gt;
EDUCATION = 0&lt;/P&gt;

&lt;P&gt;2017-Q1&lt;BR /&gt;
LAW=6&lt;BR /&gt;
BUSINESS = 0&lt;BR /&gt;
EDUCATION = 9&lt;/P&gt;

&lt;P&gt;But I want to get the cumulative people count, so that the counts end up more like&lt;/P&gt;

&lt;P&gt;2016-Q1&lt;BR /&gt;
LAW = 2&lt;BR /&gt;
BUSINESS = 11&lt;BR /&gt;
EDUCATION = 2&lt;/P&gt;

&lt;P&gt;2016-Q2&lt;BR /&gt;
LAW = 2&lt;BR /&gt;
BUSINESS = 29&lt;BR /&gt;
EDUCATION = 2&lt;/P&gt;

&lt;P&gt;LAW = 8&lt;BR /&gt;
BUSINESS = 29&lt;BR /&gt;
EDUCATION = 11&lt;/P&gt;

&lt;P&gt;I know there is an accum function but I can't get this to play with chart.&lt;/P&gt;

&lt;P&gt;Any ideas how to do this?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 05:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350294#M175203</guid>
      <dc:creator>splunk-support0</dc:creator>
      <dc:date>2017-03-10T05:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting cumulative total into chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350295#M175204</link>
      <description>&lt;P&gt;Just add the following to your existing query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Your exiting Search with chart as base search&amp;gt;
| accum LAW as Cumu_LAW 
| accum BUSINESS as Cumu_BUSINESS  
| accum EDUCATION as Cumu_EDUCATION 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you need to enable Chart Overlay  for all Cumu_* fields and View as Axis should be turned on. You can do the same by editing the Visualization in Splunk Web UI or else through Splunk CHart reference&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;charting.chart.overlayfields&amp;gt;Cumu_LAW ,Cumu_BUSINESS,Cumu_EDUCATION&amp;lt;/charting.chart.overlayfields&amp;gt;
&amp;lt;charting.Y2.enabled&amp;gt;1&amp;lt;/charting.Y2.enabled&amp;gt;
&amp;lt;charting.Y2.scale&amp;gt;linear&amp;lt;/charting.Y2.scale&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2017 13:11:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350295#M175204</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-10T13:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting cumulative total into chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350296#M175205</link>
      <description>&lt;P&gt;Assuming that the faculty name can be dynamic, try something like this. THis will give cumulative sum of all faculty column without specifying a name.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  | chart sum(people) over quarter by faculty
| streamstats sum(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2017 15:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350296#M175205</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-03-10T15:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting cumulative total into chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350297#M175206</link>
      <description>&lt;P&gt;Thank you.  This does exactly what I want.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 02:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-cumulative-total-into-chart/m-p/350297#M175206</guid>
      <dc:creator>splunk-support0</dc:creator>
      <dc:date>2017-03-13T02:10:51Z</dc:date>
    </item>
  </channel>
</rss>

