<?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: Percentage based on Grand Total in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437118#M124509</link>
    <description>&lt;P&gt;@andrehl, which version of Splunk are you on? Also what is the visualization to depict above output? Is it table or something else?&lt;/P&gt;

&lt;P&gt;If you are on &lt;CODE&gt;Splunk 6.5 or higher&lt;/CODE&gt; you can use Table format option to add Unit as &lt;CODE&gt;%&lt;/CODE&gt; rather than adding &lt;CODE&gt;%&lt;/CODE&gt; in the eval SPL command. This way your data remains numeric and still displays % in the column.&lt;/P&gt;

&lt;P&gt;Refer to Splunk Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Number_format_rules"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Number_format_rules&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jul 2018 03:58:05 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-07-18T03:58:05Z</dc:date>
    <item>
      <title>Percentage based on Grand Total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437115#M124506</link>
      <description>&lt;P&gt;index="stage"&lt;BR /&gt;
|stats dc(customers_name) as "Distinct Customer" by sku_name sku_number&lt;BR /&gt;
|rename sku_name as Product sku_number as ID&lt;BR /&gt;
|eval Rate=""Distinct Customer" / count(customers_name)"."%"&lt;/P&gt;

&lt;P&gt;Hi guys,&lt;BR /&gt;
I'm trying to calculate the percentage of the customer involved with respect to the grand total number of customers but I cant seem to use count under eval. Any help?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437115#M124506</guid>
      <dc:creator>andrehl</dc:creator>
      <dc:date>2020-09-29T20:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage based on Grand Total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437116#M124507</link>
      <description>&lt;P&gt;&lt;CODE&gt;count&lt;/CODE&gt; is a &lt;CODE&gt;stats&lt;/CODE&gt; function, not an &lt;CODE&gt;eval&lt;/CODE&gt; function.  You need to calculate count(customers_name) in a separate command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="stage"
| eventstats count(customers_name) as customerCount dc(customers_name) as "Distinct Customer" by sku_name sku_number
|rename sku_name as Product sku_number as ID
|eval Rate=('Distinct Customer' / customerCount)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 12:27:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437116#M124507</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-07-13T12:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage based on Grand Total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437117#M124508</link>
      <description>&lt;P&gt;Is it still possible to sort if we have characters under eval command?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 02:34:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437117#M124508</guid>
      <dc:creator>andrehl</dc:creator>
      <dc:date>2018-07-18T02:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage based on Grand Total</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437118#M124509</link>
      <description>&lt;P&gt;@andrehl, which version of Splunk are you on? Also what is the visualization to depict above output? Is it table or something else?&lt;/P&gt;

&lt;P&gt;If you are on &lt;CODE&gt;Splunk 6.5 or higher&lt;/CODE&gt; you can use Table format option to add Unit as &lt;CODE&gt;%&lt;/CODE&gt; rather than adding &lt;CODE&gt;%&lt;/CODE&gt; in the eval SPL command. This way your data remains numeric and still displays % in the column.&lt;/P&gt;

&lt;P&gt;Refer to Splunk Documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Number_format_rules"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML#Number_format_rules&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 03:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Percentage-based-on-Grand-Total/m-p/437118#M124509</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-18T03:58:05Z</dc:date>
    </item>
  </channel>
</rss>

