<?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 Calculate percentage of total and display as pie chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534113#M150948</link>
    <description>&lt;P&gt;I have total of 7M users. My splunk query shows the count of completed users. I want to draw a pie chart showing completed users vs Total users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have gotten this far&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&amp;lt; my query&amp;gt;&amp;gt; |&amp;nbsp;eval TotalMax=7000000 | stats count(Path) as completed | eval perc=(completed/TotalMax)/100 | table completed,perc&lt;/P&gt;&lt;P&gt;count(Path) which is same as completed comes out as 200000&lt;BR /&gt;But perc is not getting calculated.&amp;nbsp; Am I missing anything ?&lt;/P&gt;&lt;P&gt;--Sunray&lt;/P&gt;</description>
    <pubDate>Fri, 25 Dec 2020 18:43:06 GMT</pubDate>
    <dc:creator>balash1979</dc:creator>
    <dc:date>2020-12-25T18:43:06Z</dc:date>
    <item>
      <title>Calculate percentage of total and display as pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534113#M150948</link>
      <description>&lt;P&gt;I have total of 7M users. My splunk query shows the count of completed users. I want to draw a pie chart showing completed users vs Total users.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have gotten this far&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&amp;lt; my query&amp;gt;&amp;gt; |&amp;nbsp;eval TotalMax=7000000 | stats count(Path) as completed | eval perc=(completed/TotalMax)/100 | table completed,perc&lt;/P&gt;&lt;P&gt;count(Path) which is same as completed comes out as 200000&lt;BR /&gt;But perc is not getting calculated.&amp;nbsp; Am I missing anything ?&lt;/P&gt;&lt;P&gt;--Sunray&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2020 18:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534113#M150948</guid>
      <dc:creator>balash1979</dc:creator>
      <dc:date>2020-12-25T18:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage of total and display as pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534115#M150949</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/194280"&gt;@balash1979&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;After stats command only fields &amp;nbsp;that stats outputs are exist. On your case you are loosing TotalMax field, so perc cannot be calculated. Below should work;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;&amp;lt; my query&amp;gt;&amp;gt; 
| stats count(Path) as completed 
| eval TotalMax=7000000
| eval perc=(completed/TotalMax)/100 
| table completed,perc&lt;/LI-CODE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;&amp;lt; my query&amp;gt;&amp;gt; 
| eval TotalMax=7000000 
| stats count(Path) as completed values(TotalMax) as TotalMax
| eval perc=(completed/TotalMax)/100 
| table completed,perc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2020 19:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534115#M150949</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2020-12-25T19:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate percentage of total and display as pie chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534118#M150950</link>
      <description>&lt;P&gt;Thanks. If i add "table completed, perc" , i can get the correct data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i display this as a pie chart ? in the pie chart, i would like to see % completed out of the total. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2020 20:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-percentage-of-total-and-display-as-pie-chart/m-p/534118#M150950</guid>
      <dc:creator>balash1979</dc:creator>
      <dc:date>2020-12-25T20:21:44Z</dc:date>
    </item>
  </channel>
</rss>

