<?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: Sparkline returning '0' or '1' in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623413#M51120</link>
    <description>&lt;P&gt;Try this since you have already renamed sum(DEF) as DEF and sum(ABC) as ABC&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval AVG_ABC=(DEF/ABC)/60 &lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 06 Dec 2022 12:18:06 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-12-06T12:18:06Z</dc:date>
    <item>
      <title>Why is sparkline returning '0' or '1'?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623395#M51118</link>
      <description>&lt;P&gt;I have a query that returns an avg calculation over time and I am using a sparkline to try to show the results for each 'period' over that time, however although my results are showing a correct value, my sparkline only shows a value of 0 or 1.&lt;/P&gt;
&lt;P&gt;My search is:&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;
&lt;LI-CODE lang="markup"&gt;| tstats SUM(ABC) as ABC, sum(DEF) as DEF where index=FOO earliest=-4h latest=-45m by _time platform span=5m 
| eval AVG_ABC=((sum(DEF)/sum(ABC))/60) 
| stats sparkline avg(AVG_ABC) by platform&lt;/LI-CODE&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of the single line result with the sparkline over time, I get the following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sparkline2.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22880i03C808F0EB0FD68E/image-size/large?v=v2&amp;amp;px=999" role="button" title="sparkline2.png" alt="sparkline2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can anyone point me in the right direction?&amp;nbsp;Essentially I am looking to create something like a single number value viz with a trendline.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 14:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623395#M51118</guid>
      <dc:creator>lennys26</dc:creator>
      <dc:date>2022-12-06T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sparkline returning '0' or '1'</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623413#M51120</link>
      <description>&lt;P&gt;Try this since you have already renamed sum(DEF) as DEF and sum(ABC) as ABC&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval AVG_ABC=(DEF/ABC)/60 &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Dec 2022 12:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623413#M51120</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-12-06T12:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sparkline returning '0' or '1'</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623424#M51122</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@ITWhisperer" target="_blank"&gt;Hi@ITWhisperer&lt;/A&gt;. Bad SPL on my side (or perhaps i just foobar'ed by code when I was replacing all of the FOOs and BARs in my post&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;), but either way, thanks for the correction.&lt;/P&gt;&lt;P&gt;Anyhow, I have made the change, but this does not affect the end result.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sparkline.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22883i4E7C554D31EE1BCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sparkline.png" alt="Sparkline.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 13:48:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623424#M51122</guid>
      <dc:creator>lennys26</dc:creator>
      <dc:date>2022-12-06T13:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sparkline returning '0' or '1'</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623427#M51123</link>
      <description>&lt;LI-CODE lang="markup"&gt;| tstats SUM(ABC) as ABC, sum(DEF) as DEF where index=FOO earliest=-4h latest=-45m by _time platform span=5m 
| eval AVG_ABC=(DEF/ABC)/60 
| stats sparkline(avg(AVG_ABC)) by platform&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Dec 2022 14:09:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623427#M51123</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-12-06T14:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sparkline returning '0' or '1'</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623430#M51124</link>
      <description>&lt;P&gt;Ahh haa! I had spaces between the 'sparkline' and the function:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;| stats sparkline avg(AVG_LOC) by platform&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;| stats sparkline(avg(AVG_LOC)) by platform&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The strange thing is that my notes show that I have used this with the space in the past. Either way, it is working now.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 14:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-is-sparkline-returning-0-or-1/m-p/623430#M51124</guid>
      <dc:creator>lennys26</dc:creator>
      <dc:date>2022-12-06T14:28:33Z</dc:date>
    </item>
  </channel>
</rss>

