<?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 How to sum values from specific rows to then display in pie graph in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428239#M122533</link>
    <description>&lt;P&gt;Hey guys,&lt;/P&gt;

&lt;P&gt;I'm trying to add the values that correspond to specific rows in a search, to then display on a dashboard (graph/pie graph).&lt;/P&gt;

&lt;P&gt;For example, I have a table that returns as below:&lt;/P&gt;

&lt;P&gt;Scenario                                       count&lt;BR /&gt;
"C2C Scenario 1"                        1&lt;BR /&gt;
"C2C Scenario 2"                         2&lt;BR /&gt;
"C2C Scenario 3"                        3&lt;BR /&gt;
"C2C Scenario 4N"                     4&lt;BR /&gt;
"C2C Scenario 4Y"                        5&lt;BR /&gt;
"C2C Scenario 5"                          6&lt;BR /&gt;
"C2C Scenario 6"                    10&lt;/P&gt;

&lt;P&gt;The above is currently returned using the below&lt;BR /&gt;
    index=ivr_app ("C4C Scenario")| rex "C2C Scenario (?&lt;REASON&gt;\w+)" | eval Scenario = "C2C Scenario"." ".Reason | stats count by Scenario&lt;/REASON&gt;&lt;/P&gt;

&lt;P&gt;I want to have a sum of the &lt;STRONG&gt;count&lt;/STRONG&gt; &lt;BR /&gt;
"C2C Scenario 2" + "C2C Scenario 4Y" + "C2C Scenario 5" as "POSITIVE"&lt;BR /&gt;
"C2C Scenario 1" + "C2C Scenario 3" + C2C Scenario 4N" + "C2C Scenario 6" as "NEGATIVE"&lt;/P&gt;

&lt;P&gt;So end outcome would be a table that is&lt;/P&gt;

&lt;P&gt;Scenario sum&lt;BR /&gt;
POSITIVE  11&lt;BR /&gt;
NEGATIVE  18&lt;/P&gt;

&lt;P&gt;The plan will then be to display the above in a pie graph.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated! Thanks again. Loving getting into this stuff but starting off a little slow.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 05:05:52 GMT</pubDate>
    <dc:creator>hamishcross</dc:creator>
    <dc:date>2019-08-06T05:05:52Z</dc:date>
    <item>
      <title>How to sum values from specific rows to then display in pie graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428239#M122533</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;

&lt;P&gt;I'm trying to add the values that correspond to specific rows in a search, to then display on a dashboard (graph/pie graph).&lt;/P&gt;

&lt;P&gt;For example, I have a table that returns as below:&lt;/P&gt;

&lt;P&gt;Scenario                                       count&lt;BR /&gt;
"C2C Scenario 1"                        1&lt;BR /&gt;
"C2C Scenario 2"                         2&lt;BR /&gt;
"C2C Scenario 3"                        3&lt;BR /&gt;
"C2C Scenario 4N"                     4&lt;BR /&gt;
"C2C Scenario 4Y"                        5&lt;BR /&gt;
"C2C Scenario 5"                          6&lt;BR /&gt;
"C2C Scenario 6"                    10&lt;/P&gt;

&lt;P&gt;The above is currently returned using the below&lt;BR /&gt;
    index=ivr_app ("C4C Scenario")| rex "C2C Scenario (?&lt;REASON&gt;\w+)" | eval Scenario = "C2C Scenario"." ".Reason | stats count by Scenario&lt;/REASON&gt;&lt;/P&gt;

&lt;P&gt;I want to have a sum of the &lt;STRONG&gt;count&lt;/STRONG&gt; &lt;BR /&gt;
"C2C Scenario 2" + "C2C Scenario 4Y" + "C2C Scenario 5" as "POSITIVE"&lt;BR /&gt;
"C2C Scenario 1" + "C2C Scenario 3" + C2C Scenario 4N" + "C2C Scenario 6" as "NEGATIVE"&lt;/P&gt;

&lt;P&gt;So end outcome would be a table that is&lt;/P&gt;

&lt;P&gt;Scenario sum&lt;BR /&gt;
POSITIVE  11&lt;BR /&gt;
NEGATIVE  18&lt;/P&gt;

&lt;P&gt;The plan will then be to display the above in a pie graph.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated! Thanks again. Loving getting into this stuff but starting off a little slow.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 05:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428239#M122533</guid>
      <dc:creator>hamishcross</dc:creator>
      <dc:date>2019-08-06T05:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values from specific rows to then display in pie graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428240#M122534</link>
      <description>&lt;P&gt;@hamishcross,&lt;/P&gt;

&lt;P&gt;If you dont have any common field to join them, you may try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ivr_app ("C4C Scenario")| rex "C2C Scenario (?\w+)" 
 | eval Scenario = "C2C Scenario"." ".Reason | stats count by Scenario
 | stats sum(eval(if(Scenario=="C2C Scenario 2" OR Scenario=="C2C Scenario 4Y" OR Scenario=="C2C Scenario 5",count,null()))) as POSITIVE,
   sum(eval(if(Scenario=="C2C Scenario 1" OR Scenario=="C2C Scenario 3" OR Scenario=="C2C Scenario 4N" OR Scenario=="C2C Scenario 6",count,null()))) as NEGATIVE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Aug 2019 12:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428240#M122534</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-08-06T12:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values from specific rows to then display in pie graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428241#M122535</link>
      <description>&lt;P&gt;I'm pretty sure you're missing a stats ahead of the sum?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 05:22:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428241#M122535</guid>
      <dc:creator>hamishcross</dc:creator>
      <dc:date>2019-08-07T05:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values from specific rows to then display in pie graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428242#M122536</link>
      <description>&lt;P&gt;ofcourse &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; , updated&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 05:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-sum-values-from-specific-rows-to-then-display-in-pie/m-p/428242#M122536</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-08-07T05:25:00Z</dc:date>
    </item>
  </channel>
</rss>

