<?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: Table with with a column that contains positive and negative values. I want to sum the total of all values and have the results as a Total, but it ignores the negative values.  What am I doing wrong? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477564#M134013</link>
    <description>&lt;P&gt;Wow, your sample proved thing correct. Thank you.  The problem was with the negative numbers in my sample.  They actually had the $ before the value in the field.  I thought it was showing up because of table formatting that I had done in my dashboard.  I stripped the $ sign out and then the math worked.  Your answer is correct and really helped.  Thank you!  Have a great weekend.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 00:21:51 GMT</pubDate>
    <dc:creator>ihaveasplunkacc</dc:creator>
    <dc:date>2020-02-22T00:21:51Z</dc:date>
    <item>
      <title>Table with with a column that contains positive and negative values. I want to sum the total of all values and have the results as a Total, but it ignores the negative values.  What am I doing wrong?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477561#M134010</link>
      <description>&lt;P&gt;| table Account "Estimated Gain_Loss"&lt;BR /&gt;
| addcoltotals labelfield="Account" label="Totals" &lt;BR /&gt;
| sort -"Estimated Gain_Loss"&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/282697-sample.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477561#M134010</guid>
      <dc:creator>ihaveasplunkacc</dc:creator>
      <dc:date>2020-09-30T04:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Table with with a column that contains positive and negative values. I want to sum the total of all values and have the results as a Total, but it ignores the negative values.  What am I doing wrong?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477562#M134011</link>
      <description>&lt;P&gt;I just realized the sample data I posted had slight formatting error, but the problem is still the same.  The samples below have the correct values.&lt;/P&gt;

&lt;P&gt;Results in Excel with the output that I am looking for&lt;BR /&gt;&lt;BR /&gt;
Account Estimated Gain_Loss&lt;BR /&gt;
Total                3200&lt;BR /&gt;
ACCOUNT1     1000&lt;BR /&gt;
ACCOUNT2     2000&lt;BR /&gt;
ACCOUNT3     500&lt;BR /&gt;
ACCOUNT4     -300&lt;/P&gt;

&lt;P&gt;Results in Splunk with incorrect total&lt;BR /&gt;&lt;BR /&gt;
Account Estimated Gain_Loss&lt;BR /&gt;
Total                 3500&lt;BR /&gt;
ACCOUNT1     1000&lt;BR /&gt;
ACCOUNT2     2000&lt;BR /&gt;
ACCOUNT3     500&lt;BR /&gt;
ACCOUNT4     -300&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 23:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477562#M134011</guid>
      <dc:creator>ihaveasplunkacc</dc:creator>
      <dc:date>2020-02-21T23:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Table with with a column that contains positive and negative values. I want to sum the total of all values and have the results as a Total, but it ignores the negative values.  What am I doing wrong?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477563#M134012</link>
      <description>&lt;P&gt;hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/45218"&gt;@ihaveasplunkacc&lt;/a&gt;ount &lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="Account Estimated_Gain_Loss&lt;BR /&gt;
ACCOUNT1 1000&lt;BR /&gt;
ACCOUNT2 2000&lt;BR /&gt;
ACCOUNT3 500&lt;BR /&gt;
ACCOUNT4 -300"&lt;BR /&gt;
| multikv forceheader=1&lt;BR /&gt;
| table Account Estimated_Gain_Loss&lt;BR /&gt;
| addcoltotals labelfield=Account&lt;/P&gt;

&lt;P&gt;This query shows correct result. but,&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="Account Estimated_Gain_Loss&lt;BR /&gt;
ACCOUNT1 $1000&lt;BR /&gt;
ACCOUNT2 $2000&lt;BR /&gt;
ACCOUNT3 $500&lt;BR /&gt;
ACCOUNT4 -$300"&lt;BR /&gt;
| multikv forceheader=1&lt;BR /&gt;
| table Account Estimated_Gain_Loss&lt;BR /&gt;
| addcoltotals labelfield=Account&lt;/P&gt;

&lt;P&gt;this query is not work.&lt;/P&gt;

&lt;P&gt;your sample has &lt;CODE&gt;$&lt;/CODE&gt; mark.  Actually, is this right?&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="Account Estimated_Gain_Loss&lt;BR /&gt;
ACCOUNT1 $1000&lt;BR /&gt;
ACCOUNT2 $2000&lt;BR /&gt;
ACCOUNT3 $500&lt;BR /&gt;
ACCOUNT4 -$300" &lt;BR /&gt;
| multikv forceheader=1 &lt;BR /&gt;
| table Account Estimated_Gain_Loss&lt;BR /&gt;
| eval Estimated_Gain_Loss=replace(Estimated_Gain_Loss,"\$","")&lt;BR /&gt;
| addcoltotals labelfield=Account&lt;/P&gt;

&lt;P&gt;this query excludes &lt;CODE&gt;$&lt;/CODE&gt; mark and calculates total.&lt;BR /&gt;
sorry, why I don't use &lt;EM&gt;Code Sample&lt;/EM&gt; is because extra space is added. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477563#M134012</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-30T04:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Table with with a column that contains positive and negative values. I want to sum the total of all values and have the results as a Total, but it ignores the negative values.  What am I doing wrong?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477564#M134013</link>
      <description>&lt;P&gt;Wow, your sample proved thing correct. Thank you.  The problem was with the negative numbers in my sample.  They actually had the $ before the value in the field.  I thought it was showing up because of table formatting that I had done in my dashboard.  I stripped the $ sign out and then the math worked.  Your answer is correct and really helped.  Thank you!  Have a great weekend.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 00:21:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Table-with-with-a-column-that-contains-positive-and-negative/m-p/477564#M134013</guid>
      <dc:creator>ihaveasplunkacc</dc:creator>
      <dc:date>2020-02-22T00:21:51Z</dc:date>
    </item>
  </channel>
</rss>

