<?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: Display stats percentage in row instead of columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554587#M157407</link>
    <description>&lt;P&gt;You could try something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Success%=if(SystemA_TranName=="Total",printf("%.2f%%",((Success/Total_Transaction_Counts)*100)),"")
| eval Failed%=if(SystemA_TranName=="Total",printf("%.2f%%",((Failed/Total_Transaction_Counts)*100)),"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 05 Jun 2021 09:06:47 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-06-05T09:06:47Z</dc:date>
    <item>
      <title>Display stats percentage in row instead of columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554572#M157402</link>
      <description>&lt;P&gt;Hi Splunk experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm generating stats from 3 indexes (System A, B, C) and the results look like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new2splunk1_3-1622866839549.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14490iD6573E412AB613A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="new2splunk1_3-1622866839549.png" alt="new2splunk1_3-1622866839549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The totals, Success%, Failed% are calcuated based on the below commands:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;| addcoltotals col=t labelfield=SystemA_TranName&lt;/P&gt;&lt;P&gt;| eval Success%=if(SystemA_TranName=="Total",round((Success/Total_Transaction_Counts)*100,2)."%","")&lt;BR /&gt;| eval Failed%=if(SystemA_TranName=="Total",round((Failed/Total_Transaction_Counts)*100,2)."%","")&lt;/P&gt;&lt;P&gt;My requirement is to show the Success% and Failed% columns highlighted in Table 1 by adding a &lt;STRONG&gt;Percentage&lt;/STRONG&gt;&amp;nbsp;row to the end &amp;nbsp;and display the percentage values in&amp;nbsp;&lt;STRONG&gt;Success column&lt;/STRONG&gt; and &lt;STRONG&gt;Failed column &lt;/STRONG&gt;as shown in Table 2 below.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new2splunk1_2-1622866798787.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14489i79F46711A32A08F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="new2splunk1_2-1622866798787.png" alt="new2splunk1_2-1622866798787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I'm trying to get the desired results as shown in Table 2 by writing the below query:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;| addcoltotals col=t labelfield=SystemA_TranName&lt;BR /&gt;| eval Success%=if(SystemA_TranName=="Total",round((Success/Total_Transaction_Counts)*100,2)."%","")&lt;BR /&gt;| eval Failed%=if(SystemA_TranName=="Total",round((Failed/Total_Transaction_Counts)*100,2)."%","")&lt;BR /&gt;| fields SystemA_TranName, SystemA_TranStatus, SystemB_TranName, SystemB_TranStatus, SystemC_TranName, SystemC_TranStatus, Total_Transaction_Counts, Success, Failed&lt;BR /&gt;| append [| gentimes start=-1&lt;BR /&gt;| eval SystemA_TranName="Percentage"&lt;BR /&gt;| eval SystemA_TranStatus=""&lt;BR /&gt;| eval SystemB_TranName=""&lt;BR /&gt;| eval SystemB_TranStatus=""&lt;BR /&gt;| eval SystemC_TranName=""&lt;BR /&gt;| eval SystemC_TranStatus=""&lt;BR /&gt;| eval Total_Transaction_Counts=""&lt;BR /&gt;| eval Success=Success%&lt;BR /&gt;| eval Failed=Failed%&lt;BR /&gt;| table SystemA_TranName SystemA_TranStatus SystemB_TranName SystemB_TranStatus SystemC_TranName SystemC_TranStatus Total_Transaction_Counts Success Failed]&lt;/P&gt;&lt;P&gt;As shown in Table 3 below, I'm able to add a &lt;STRONG&gt;Percentage&lt;/STRONG&gt; row to the end&amp;nbsp;but the percentage values &lt;STRONG&gt;80.00%&lt;/STRONG&gt; and &lt;STRONG&gt;25.00%&lt;/STRONG&gt; are not displayed in &lt;STRONG&gt;Success&lt;/STRONG&gt; and &lt;STRONG&gt;Failed&lt;/STRONG&gt; &lt;STRONG&gt;column&lt;/STRONG&gt; respectively. Any suggestions, please?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table3:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new2splunk1_4-1622867169782.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14491i65128B938F58377C/image-size/large?v=v2&amp;amp;px=999" role="button" title="new2splunk1_4-1622867169782.png" alt="new2splunk1_4-1622867169782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 04:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554572#M157402</guid>
      <dc:creator>new2splunk1</dc:creator>
      <dc:date>2021-06-05T04:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Display stats percentage in row instead of columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554573#M157403</link>
      <description>&lt;P&gt;Change the last part (from append onwards) to something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| append [| makeresults
| eval SystemA_TranName="Percentage"
| table SystemA_TranName]
| filldown Success% Failed%
| eval Success=if(SystemA_TranName="Percentage",Success%,Success)
| eval Failed=if(SystemA_TranName="Percentage",Failed%,Failed)
| table SystemA_TranName SystemA_TranStatus SystemB_TranName SystemB_TranStatus SystemC_TranName SystemC_TranStatus Total_Transaction_Counts Success Failed]&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 05 Jun 2021 05:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554573#M157403</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-05T05:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Display stats percentage in row instead of columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554580#M157405</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you so much. This really helps.&amp;nbsp; One last input needed. The percentage value is displayed only if I remove the blue text from the &lt;STRONG&gt;Success%&lt;/STRONG&gt; and &lt;STRONG&gt;Failed%&lt;/STRONG&gt; calculation.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;| eval &lt;STRONG&gt;Success%&lt;/STRONG&gt;=if(SystemA_TranName=="Total",round((Success/Total_Transaction_Counts)*100,2)&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;."%"&lt;/FONT&gt;&lt;/STRONG&gt;,"")&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;| eval &lt;STRONG&gt;Failed%&lt;/STRONG&gt;=if(SystemA_TranName=="Total",round((Failed/Total_Transaction_Counts)*100,2)&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;."%&lt;/STRONG&gt;"&lt;/FONT&gt;,"")&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;I also tried adding&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;.&lt;FONT color="#0000FF"&gt;"&lt;/FONT&gt;%" &lt;/STRONG&gt;&lt;/FONT&gt;to the below commands after the filldown command but it wouldn't work either.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;| eval &lt;STRONG&gt;Success&lt;/STRONG&gt;=if(SystemA_TranName=="Percentage",Success%&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;."%"&lt;/STRONG&gt;&lt;/FONT&gt;,Success)&lt;BR /&gt;| eval &lt;STRONG&gt;Failed&lt;/STRONG&gt;=if(SystemA_TranName=="Percentage",Failed%&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;."%"&lt;/STRONG&gt;&lt;/FONT&gt;,Failed)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;Is there anway to have the &lt;STRONG&gt;% symbol&lt;/STRONG&gt; displayed after the percentage value?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 08:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554580#M157405</guid>
      <dc:creator>new2splunk1</dc:creator>
      <dc:date>2021-06-05T08:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display stats percentage in row instead of columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554587#M157407</link>
      <description>&lt;P&gt;You could try something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Success%=if(SystemA_TranName=="Total",printf("%.2f%%",((Success/Total_Transaction_Counts)*100)),"")
| eval Failed%=if(SystemA_TranName=="Total",printf("%.2f%%",((Failed/Total_Transaction_Counts)*100)),"")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 09:06:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554587#M157407</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-05T09:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Display stats percentage in row instead of columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554589#M157408</link>
      <description>&lt;P&gt;Thanks so much. Works like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 10:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-stats-percentage-in-row-instead-of-columns/m-p/554589#M157408</guid>
      <dc:creator>new2splunk1</dc:creator>
      <dc:date>2021-06-05T10:48:24Z</dc:date>
    </item>
  </channel>
</rss>

