<?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: How do you add percentage of total for several columns in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455355#M128756</link>
    <description>&lt;P&gt;Hi Renjith,&lt;BR /&gt;
it works great &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thank you very much for your fast and effective help&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 16:52:00 GMT</pubDate>
    <dc:creator>alessandrocicch</dc:creator>
    <dc:date>2018-10-30T16:52:00Z</dc:date>
    <item>
      <title>How do you add percentage of total for several columns in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455352#M128753</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I'm quite new to Splunk and I'm struggling trying to add percentages to a table that I built from two indexes (sorry if the same question has been already asked, but I didn't find any applicable to my case).&lt;/P&gt;

&lt;P&gt;The table I have looks like this:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/6021i1CDA35EB9F154CA3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What I'm trying to do now is add, for each column, percentages of total: for example Actual_Sept % = 536 /1640 and 1104 / 1640 and so on for all columns&lt;/P&gt;

&lt;P&gt;Hope you can help on this,&lt;/P&gt;

&lt;P&gt;thanks anyway&lt;/P&gt;

&lt;P&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:41:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455352#M128753</guid>
      <dc:creator>alessandrocicch</dc:creator>
      <dc:date>2018-10-30T14:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add percentage of total for several columns in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455353#M128754</link>
      <description>&lt;P&gt;@alessandrocicchella,&lt;/P&gt;

&lt;P&gt;If you could remove &lt;CODE&gt;addcoltotals&lt;/CODE&gt; from your search, give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Your search without addcoltotals (or the last row) " |eventstats sum(*) as sum_*
|foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;_%=&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;/sum_&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;]|fields - sum_*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If  this does not work, please provide the search  used to find the current count/values under each field, we shall try alternative/better searches.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:29:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455353#M128754</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-30T16:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add percentage of total for several columns in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455354#M128755</link>
      <description>&lt;P&gt;With the eval command is quite simple to do that; something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Percentage= round(100 * Count / Total,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However I don't understand how you are using the fields in your table; if i understood correctly the "Actual_Sept"  field has in it the values of both the dividend and the divisor. Is that correct? &lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455354#M128755</guid>
      <dc:creator>jlelli</dc:creator>
      <dc:date>2018-10-30T16:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you add percentage of total for several columns in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455355#M128756</link>
      <description>&lt;P&gt;Hi Renjith,&lt;BR /&gt;
it works great &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thank you very much for your fast and effective help&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-add-percentage-of-total-for-several-columns-in-a/m-p/455355#M128756</guid>
      <dc:creator>alessandrocicch</dc:creator>
      <dc:date>2018-10-30T16:52:00Z</dc:date>
    </item>
  </channel>
</rss>

