<?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: overall sum and aggregate sum in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547978#M155389</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233446"&gt;@yuming1127&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's something odd in your SPL&lt;/P&gt;&lt;P&gt;In the eval line you are adding the following &lt;STRONG&gt;numbers&lt;/STRONG&gt; together&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval effort=exact(21+31+61+1103+7306+7505+15105+15106+15122)&lt;/LI-CODE&gt;&lt;P&gt;so here effort evaluates to the number 61360&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;BUT &lt;FONT color="#000000"&gt;in this statement&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table tag,effort,16910,21,31,61,1103,7306,7505,15105,15106,15122&lt;/LI-CODE&gt;&lt;P&gt;you are using these 'numbers' as fields and in your image they are actually field names containing only numbers.&lt;/P&gt;&lt;P&gt;So, the problem is that your eval statement is wrong in that it is adding up numbers not fields. In order to treat those fields as fields not numbers, you need to wrap them in single quotes, '. So your eval should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval effort=('21'+'31'+'61'+'1103'+'7306'+'7505'+'15105'+'15106'+'15122')&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;BUT&lt;/FONT&gt; that will not give you your result for all rows, as the '21' field in row 1 in your example has no value, so will make 'effort' have no value.&lt;/P&gt;&lt;P&gt;You should use addtotals as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;suggests and that will handle ALL fields or just the ones you specify and also handle the null value case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Apr 2021 06:14:52 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-04-15T06:14:52Z</dc:date>
    <item>
      <title>overall sum and aggregate sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547824#M155347</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yuming1127_1-1618371569128.png" style="width: 454px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13755i29167F93D1DD3217/image-dimensions/454x184?v=v2" width="454" height="184" role="button" title="yuming1127_1-1618371569128.png" alt="yuming1127_1-1618371569128.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;command:&lt;/P&gt;&lt;P class="lia-align-left"&gt;search....&lt;/P&gt;&lt;P class="lia-align-left"&gt;| eval effort=exact(21+31+61+1103+7306+7505+15105+15106+15122)&lt;BR /&gt;| table tag,effort,16910,21,31,61,1103,7306,7505,15105,15106,15122&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;how can i get effort = sum of field in same row instead of overall sum.&lt;/P&gt;&lt;P&gt;expected output:&lt;/P&gt;&lt;P&gt;effort&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 03:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547824#M155347</guid>
      <dc:creator>yuming1127</dc:creator>
      <dc:date>2021-04-14T03:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: overall sum and aggregate sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547828#M155349</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233446"&gt;@yuming1127&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use addtotals command;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval effort=exact(21+31+61+1103+7306+7505+15105+15106+15122)
| table tag,effort,16910,21,31,61,1103,7306,7505,15105,15106,15122
| addtotals&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547828#M155349</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-04-14T04:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: overall sum and aggregate sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547832#M155351</link>
      <description>&lt;P&gt;Great one, really appreciate your solution. Quick and easy&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 04:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547832#M155351</guid>
      <dc:creator>yuming1127</dc:creator>
      <dc:date>2021-04-14T04:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: overall sum and aggregate sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547978#M155389</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233446"&gt;@yuming1127&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's something odd in your SPL&lt;/P&gt;&lt;P&gt;In the eval line you are adding the following &lt;STRONG&gt;numbers&lt;/STRONG&gt; together&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval effort=exact(21+31+61+1103+7306+7505+15105+15106+15122)&lt;/LI-CODE&gt;&lt;P&gt;so here effort evaluates to the number 61360&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;BUT &lt;FONT color="#000000"&gt;in this statement&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table tag,effort,16910,21,31,61,1103,7306,7505,15105,15106,15122&lt;/LI-CODE&gt;&lt;P&gt;you are using these 'numbers' as fields and in your image they are actually field names containing only numbers.&lt;/P&gt;&lt;P&gt;So, the problem is that your eval statement is wrong in that it is adding up numbers not fields. In order to treat those fields as fields not numbers, you need to wrap them in single quotes, '. So your eval should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval effort=('21'+'31'+'61'+'1103'+'7306'+'7505'+'15105'+'15106'+'15122')&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;BUT&lt;/FONT&gt; that will not give you your result for all rows, as the '21' field in row 1 in your example has no value, so will make 'effort' have no value.&lt;/P&gt;&lt;P&gt;You should use addtotals as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;suggests and that will handle ALL fields or just the ones you specify and also handle the null value case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 06:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/547978#M155389</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-04-15T06:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: overall sum and aggregate sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/548735#M155673</link>
      <description>&lt;P&gt;ya, found a way to replace the null value with 0 and follow up with eval function, that worked too. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 07:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/overall-sum-and-aggregate-sum/m-p/548735#M155673</guid>
      <dc:creator>yuming1127</dc:creator>
      <dc:date>2021-04-21T07:47:14Z</dc:date>
    </item>
  </channel>
</rss>

