<?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 How to convert decimal numbers to percentage? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297241#M89679</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;With my below query, how can I convert the value of %Empty and %Occupied to Percentage instead of decimal? then add the % sign?&lt;BR /&gt;
Thanks a lot!&lt;/P&gt;

&lt;P&gt;| chart values(NOOFEMPTYLOCATIONS) AS EMPTY eval(values(NOOFLOCATIONS)-values(NOOFEMPTYLOCATIONS)) as OCCUPIED eval(values(NOOFEMPTYLOCATIONS)/values(NOOFLOCATIONS)) as %EMPTY eval((values(NOOFLOCATIONS)-values(NOOFEMPTYLOCATIONS))/values(NOOFLOCATIONS)) as %OCCUPIED by Aisle&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2018 12:26:01 GMT</pubDate>
    <dc:creator>auaave</dc:creator>
    <dc:date>2018-02-17T12:26:01Z</dc:date>
    <item>
      <title>How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297241#M89679</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;With my below query, how can I convert the value of %Empty and %Occupied to Percentage instead of decimal? then add the % sign?&lt;BR /&gt;
Thanks a lot!&lt;/P&gt;

&lt;P&gt;| chart values(NOOFEMPTYLOCATIONS) AS EMPTY eval(values(NOOFLOCATIONS)-values(NOOFEMPTYLOCATIONS)) as OCCUPIED eval(values(NOOFEMPTYLOCATIONS)/values(NOOFLOCATIONS)) as %EMPTY eval((values(NOOFLOCATIONS)-values(NOOFEMPTYLOCATIONS))/values(NOOFLOCATIONS)) as %OCCUPIED by Aisle&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 12:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297241#M89679</guid>
      <dc:creator>auaave</dc:creator>
      <dc:date>2018-02-17T12:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297242#M89680</link>
      <description>&lt;P&gt;try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval %EMPTY =round(%EMPTY*100)."%", %OCCUPIED=round(%OCCUPIED*100)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2018 12:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297242#M89680</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-17T12:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297243#M89681</link>
      <description>&lt;P&gt;When changing only display&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|fieldformat %EMPTY=tostring('%EMPTY'*100)."%"
|fieldformat %OCCUPIED=tostring('%OCCUPIED'*100)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2018 15:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297243#M89681</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-02-17T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297244#M89682</link>
      <description>&lt;P&gt;I got an error so I fixed it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval %EMPTY=round('%EMPTY'*100)."%", %OCCUPIED=round('%OCCUPIED'*100)."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2018 15:45:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297244#M89682</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-02-17T15:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297245#M89683</link>
      <description>&lt;P&gt;@auaave when you are aliasing the field name it is better you do not have special character i.e. &lt;CODE&gt;%&lt;/CODE&gt;. That should be your final step before presenting to users i.e. &lt;CODE&gt;| rename EMPTY_PERC as "Empty %"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Which is the visualization you are using? Most Visualization settings allow you to round off the value without decimal using &lt;CODE&gt;Number Formatting&lt;/CODE&gt; and also change the display unit as per your needs like &lt;CODE&gt;%&lt;/CODE&gt;, &lt;CODE&gt;KBs&lt;/CODE&gt; etc.&lt;/P&gt;

&lt;P&gt;In other words if you can give your current output with expected, the solution can be directly in &lt;CODE&gt;UI Edit&lt;/CODE&gt; options to &lt;CODE&gt;Format Visualization&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 03:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297245#M89683</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-18T03:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297246#M89684</link>
      <description>&lt;P&gt;@niketnilay, thanks a lot for your advise. I will be using the stacked column chart for the %empty and %occupied, then include the statistics with the values. &lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 10:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297246#M89684</guid>
      <dc:creator>auaave</dc:creator>
      <dc:date>2018-02-18T10:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert decimal numbers to percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297247#M89685</link>
      <description>&lt;P&gt;thanks @493669 and @HiroshiSatoh! this works for me! Appreciate your help guys! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 10:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-decimal-numbers-to-percentage/m-p/297247#M89685</guid>
      <dc:creator>auaave</dc:creator>
      <dc:date>2018-02-18T10:48:19Z</dc:date>
    </item>
  </channel>
</rss>

