<?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: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145127#M185139</link>
    <description>&lt;P&gt;Finally this works. Thank you all for the help. This displays the count as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source =/opt/data/splunkLogs/order_transaction.log | dedup OrderId | top OrderStatus | eval OrderStatus=OrderStatus." :".count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Used this to display percentage in the XML as provided earlier.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.chart.showPercent"&amp;gt;true&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Feb 2015 20:07:21 GMT</pubDate>
    <dc:creator>rajendra_b</dc:creator>
    <dc:date>2015-02-17T20:07:21Z</dc:date>
    <item>
      <title>Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145120#M185132</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;source =/opt/data/splunkLogs/order_transaction.log | eval TotalOrders=if(match(OrderStatus,"In Progress"),count,0) | eval CompOrders=if(match(OrderStatus,"Complete"),count,0) | eval ErrOrders=if(match(OrderStatus,"In Error"),count,0) | eval InProgOrders=(TotalOrders - CompOrders - ErrOrders)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;I want to calculate these values from the events:&lt;/STRONG&gt;&lt;BR /&gt;
Total Orders = All orders with In progress status.&lt;BR /&gt;
Complete Orders = All orders with Complete status.&lt;BR /&gt;
Orders in Error = All orders with In Error status.&lt;BR /&gt;
Inpogress Orders = TotalOrders - CompleteOrders - InErrorOrders&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145120#M185132</guid>
      <dc:creator>rajendra_b</dc:creator>
      <dc:date>2015-02-16T14:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145121#M185133</link>
      <description>&lt;P&gt;Hi rajendra_b,&lt;/P&gt;

&lt;P&gt;use either &lt;CODE&gt;eval TotalOrders=if(match(OrderStatus,"In Progress"),count,"0")&lt;/CODE&gt; &lt;BR /&gt;
or &lt;CODE&gt;eval TotalOrders=if(match(OrderStatus,"In Progress"),count,null())&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 14:31:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145121#M185133</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-02-16T14:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145122#M185134</link>
      <description>&lt;P&gt;Thanks for responding. I modified it like below and it works now. However when I use this in Pie chart the values are only displayed when you hover the mouse on it, I want it to display on the panel as well. How can we do that.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source =/opt/data/splunkLogs/order_transaction.log | dedup OrderId | stats count(eval(OrderStatus="In Progress")) AS InProgOrders, count(eval(OrderStatus="Complete")) AS CompOrders, count(eval(OrderStatus="In Error")) AS ErrOrders | eval TotalOrders=(InProgOrders + CompOrders + ErrOrders) | table TotalOrders, CompOrders, InProgOrders, ErrOrders
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Feb 2015 20:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145122#M185134</guid>
      <dc:creator>rajendra_b</dc:creator>
      <dc:date>2015-02-16T20:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145123#M185135</link>
      <description>&lt;P&gt;You can only show percentages along with labels but not the counts&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;option name="charting.chart.showPercent"&amp;gt;true&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Feb 2015 02:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145123#M185135</guid>
      <dc:creator>ramdaspr</dc:creator>
      <dc:date>2015-02-17T02:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145124#M185136</link>
      <description>&lt;P&gt;Hi, this is indeed possible if you use some tricks &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Take a look at this answer &lt;A href="http://answers.splunk.com/answers/91517/displaying-count-as-label-in-pie-graph.html"&gt;http://answers.splunk.com/answers/91517/displaying-count-as-label-in-pie-graph.html&lt;/A&gt; or at this app &lt;A href="https://apps.splunk.com/app/1161/"&gt;https://apps.splunk.com/app/1161/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 06:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145124#M185136</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-02-17T06:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145125#M185137</link>
      <description>&lt;P&gt;MuS,&lt;BR /&gt;
             Thanks a lot for the suggestions. The Percentage is being displayed, however the count is not. I am trying different ways to render the count. Here is my query just in case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source =/opt/data/splunkLogs/order_transaction.log | dedup OrderId | stats count(eval(OrderStatus="In Progress")) AS InProgress, count(eval(OrderStatus="Complete")) AS Complete, count(eval(OrderStatus="In Error")) AS Error |  transpose 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Feb 2015 19:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145125#M185137</guid>
      <dc:creator>rajendra_b</dc:creator>
      <dc:date>2015-02-17T19:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145126#M185138</link>
      <description>&lt;P&gt;Thanks a lot for the help Ramdaspr. The Percentage works.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 19:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145126#M185138</guid>
      <dc:creator>rajendra_b</dc:creator>
      <dc:date>2015-02-17T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated values showing wrong results. I have the search string attached, what am I doign wrong, here</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145127#M185139</link>
      <description>&lt;P&gt;Finally this works. Thank you all for the help. This displays the count as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source =/opt/data/splunkLogs/order_transaction.log | dedup OrderId | top OrderStatus | eval OrderStatus=OrderStatus." :".count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Used this to display percentage in the XML as provided earlier.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;option name="charting.chart.showPercent"&amp;gt;true&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Feb 2015 20:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculated-values-showing-wrong-results-I-have-the-search-string/m-p/145127#M185139</guid>
      <dc:creator>rajendra_b</dc:creator>
      <dc:date>2015-02-17T20:07:21Z</dc:date>
    </item>
  </channel>
</rss>

