<?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 get multiple percentage results in one table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-multiple-percentage-results-in-one-table/m-p/384577#M112309</link>
    <description>&lt;P&gt;Hi @stephenmeyers&lt;/P&gt;

&lt;P&gt;Try this, considered column name as&lt;CODE&gt;Team,Result&lt;/CODE&gt; in index&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query...| stats count as played, count(eval(Result=="win")) as win,count(eval(Result=="loss")) as loss,count(eval(Result=="tie")) as tie by Team 
| eval loss=round(loss/played*100,2)."%", win=round(win/played*100,2)."%", tie=round(tie/played*100,2)."%" 
| rename played as "Game Played", win as "Win%", loss as "Loss%", tie as "Tie%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://i.ibb.co/F3KVvcb/testimg.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2019 15:20:25 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-02-15T15:20:25Z</dc:date>
    <item>
      <title>How do you get multiple percentage results in one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-multiple-percentage-results-in-one-table/m-p/384576#M112308</link>
      <description>&lt;P&gt;I would like to report the total number games played per team, and the percentage of wins, losses, and ties by team. Example data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;team=A result=win
team=A result=loss
team=B result=win
team=B result=win
team=B result=tie
team=A result=loss
team=B result=win
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Desired Splunk output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Team    Games Played    Win %    Loss %    Tie %
A       3               33%      66%       0%
B       4               75%      0%        25%
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 14:57:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-multiple-percentage-results-in-one-table/m-p/384576#M112308</guid>
      <dc:creator>stephenmeyers</dc:creator>
      <dc:date>2019-02-15T14:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get multiple percentage results in one table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-multiple-percentage-results-in-one-table/m-p/384577#M112309</link>
      <description>&lt;P&gt;Hi @stephenmeyers&lt;/P&gt;

&lt;P&gt;Try this, considered column name as&lt;CODE&gt;Team,Result&lt;/CODE&gt; in index&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query...| stats count as played, count(eval(Result=="win")) as win,count(eval(Result=="loss")) as loss,count(eval(Result=="tie")) as tie by Team 
| eval loss=round(loss/played*100,2)."%", win=round(win/played*100,2)."%", tie=round(tie/played*100,2)."%" 
| rename played as "Game Played", win as "Win%", loss as "Loss%", tie as "Tie%"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://i.ibb.co/F3KVvcb/testimg.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 15:20:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-multiple-percentage-results-in-one-table/m-p/384577#M112309</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-02-15T15:20:25Z</dc:date>
    </item>
  </channel>
</rss>

