<?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 Eval math expression over null values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90952#M23405</link>
    <description>&lt;P&gt;How can I get a result out of an eval expression (without falsely decreasing the result computing its components as 0) if I there is a day and a half which I have no data?&lt;BR /&gt;&lt;BR /&gt;
My goal is to timechart a score with that gap in it, not represent the lack of data as 0.&lt;/P&gt;

&lt;P&gt;If I replace the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TotalEvents,0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TotalEvents,"" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in the eval expressions,&lt;BR /&gt;
The CpuScore eval just breaks and is &lt;STRONG&gt;always&lt;/STRONG&gt; null acroos All Time, even on the other days which I have data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval ACpuApdex=if(Platform="A",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval BCpuApdex=if(Platform="B",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
...
| eval BCpuApdex=if(Platform="K",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval CpuScore=round(
100*(
0.16*(0.7*ACpuApdex + B*FeCpuApdex)
+ 0.16*CCpuApdex 
...
)
)
| timechart span=1d sum(CpuScore) as CpuScore
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Apr 2013 18:41:48 GMT</pubDate>
    <dc:creator>splunk_zen</dc:creator>
    <dc:date>2013-04-11T18:41:48Z</dc:date>
    <item>
      <title>Eval math expression over null values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90952#M23405</link>
      <description>&lt;P&gt;How can I get a result out of an eval expression (without falsely decreasing the result computing its components as 0) if I there is a day and a half which I have no data?&lt;BR /&gt;&lt;BR /&gt;
My goal is to timechart a score with that gap in it, not represent the lack of data as 0.&lt;/P&gt;

&lt;P&gt;If I replace the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TotalEvents,0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TotalEvents,"" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in the eval expressions,&lt;BR /&gt;
The CpuScore eval just breaks and is &lt;STRONG&gt;always&lt;/STRONG&gt; null acroos All Time, even on the other days which I have data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval ACpuApdex=if(Platform="A",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval BCpuApdex=if(Platform="B",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
...
| eval BCpuApdex=if(Platform="K",(TotalOptimumCpu + TotalAcceptableCpu/2) / TotalEvents,0)
| eval CpuScore=round(
100*(
0.16*(0.7*ACpuApdex + B*FeCpuApdex)
+ 0.16*CCpuApdex 
...
)
)
| timechart span=1d sum(CpuScore) as CpuScore
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2013 18:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90952#M23405</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-04-11T18:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Eval math expression over null values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90953#M23406</link>
      <description>&lt;P&gt;Have tried:&lt;BR /&gt;
    | timechart &lt;STRONG&gt;cont=false&lt;/STRONG&gt; span=1d sum(CpuScore) as CpuScore&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2013 19:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90953#M23406</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2013-04-11T19:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Eval math expression over null values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90954#M23407</link>
      <description>&lt;P&gt;Thanks Ipolo.&lt;BR /&gt;
The issue is that the result of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval CpuScore=...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is either 0 in that given day(if I leave the TotalEvents,0&lt;BR /&gt;
in the previous eval expressions)&lt;BR /&gt;&lt;BR /&gt;
or null across All Time (if I replace it by TotalEvents,"")&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 07:53:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-math-expression-over-null-values/m-p/90954#M23407</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-04-12T07:53:22Z</dc:date>
    </item>
  </channel>
</rss>

