<?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 I edit my search to calculate a percentage using values from a row that have a specific value in a column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233380#M69284</link>
    <description>&lt;P&gt;HI @iguinn, thank you very much for taking the time to come back to me with this.&lt;/P&gt;

&lt;P&gt;I needed to make a very minor tweak changing *100 to  1 and it works great.&lt;/P&gt;

&lt;P&gt;Once many thanks for your help and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2015 08:07:21 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2015-11-12T08:07:21Z</dc:date>
    <item>
      <title>How do I edit my search to calculate a percentage using values from a row that have a specific value in a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233378#M69282</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please&lt;/P&gt;

&lt;P&gt;I'm using the search below to produce the screenshot as shown in the attachment:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main auditSource=frontend auditType=Survey detail.overall!="None" 
| replace frontend with "Overall Satisfaction" 
| rename detail.overall As "Rating" 
| replace 1 with "Very Satisfied", 2 with "Satisfied", 3 with "Neither", 4 with "Dissatisfied", 5 with "Very Dissatisfied" 
|  chart count by Rating 
| eval "Rating Score"=case(Rating="Very Satisfied", 100, Rating="Satisfied", 75 , Rating="Neither", 50, Rating="Dissatisfied", 25, Rating="Very Dissatisfied", 0 , 1=1, 0) 
| addcoltotals | fillnull value="Total" | rename count as "Total Replies" 
| table "Rating", "Total Replies", "Rating Score"
| eval "Rating Calculation" = 'Total Replies' * 'Rating Score'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&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/821i4C92959FE031AF73/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;I don't even know whether this possible, but what I'd like to do is perform the following calculation using &lt;STRONG&gt;only&lt;/STRONG&gt; the "Total" row figures.&lt;/P&gt;

&lt;P&gt;Rating Calculation / Total Replies and formatted to a percentage with one decimal point.&lt;/P&gt;

&lt;P&gt;I've spent a couple of days searching the web to see if I can find suitable solutions without any success.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NB.&lt;/STRONG&gt; I will be putting this is a dashboard if it helps.&lt;/P&gt;

&lt;P&gt;I just wondered whether someone may be able to look at this please and offer some guidance on how I may be able to achieve this.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 07:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233378#M69282</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-11-12T07:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate a percentage using values from a row that have a specific value in a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233379#M69283</link>
      <description>&lt;P&gt;At the end of your search, add the following line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Percentage=if(Rating=="Total",tostring(round('Rating Calculation' *100 / 'Total Replies',1)) + "%",null())
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2015 07:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233379#M69283</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-11-12T07:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate a percentage using values from a row that have a specific value in a column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233380#M69284</link>
      <description>&lt;P&gt;HI @iguinn, thank you very much for taking the time to come back to me with this.&lt;/P&gt;

&lt;P&gt;I needed to make a very minor tweak changing *100 to  1 and it works great.&lt;/P&gt;

&lt;P&gt;Once many thanks for your help and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 08:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-a-percentage-using-values/m-p/233380#M69284</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2015-11-12T08:07:21Z</dc:date>
    </item>
  </channel>
</rss>

