<?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 to round Totals for Statistics under Format Summary? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672040#M230255</link>
    <description>&lt;P&gt;The total in your case is calculated by the visualization itself (which means your browser). Apparently the JS which calculates the totals treats all your row values as floating point numbers. And floating number calculations do tend to lead to ugly rounding errors.&lt;/P&gt;&lt;P&gt;You could file a bug on that because it's indeed ugly.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2023 15:00:02 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2023-12-15T15:00:02Z</dc:date>
    <item>
      <title>How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671184#M230028</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello&lt;BR /&gt;When I turned on &lt;STRONG&gt;Total&lt;/STRONG&gt; for Statistics under Format &amp;gt; Summary, the output shows long digit after decimal point: &lt;STRONG&gt;Total:&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;1129.3600000000001&lt;/STRONG&gt;&lt;BR /&gt;How do I round this number to 1129 or 1130?&amp;nbsp; &amp;nbsp;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Student, Score
a,153.8
b,154.8
c,131.7
d,115.4
e,103.2
f,95.4
g,95.4
h,93.2
i,93.2
j,93.26"
| table Student, Score&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CloudGuy_0-1701974670546.png" style="width: 687px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28417i3B7E8C8F63B81C7E/image-dimensions/687x489?v=v2" width="687" height="489" role="button" title="CloudGuy_0-1701974670546.png" alt="CloudGuy_0-1701974670546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671184#M230028</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-07T18:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671205#M230034</link>
      <description>&lt;P&gt;I don't know if it's possible, but you can add your own totals by appending&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| addcoltotals&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Dec 2023 00:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671205#M230034</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-08T00:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671208#M230035</link>
      <description>&lt;P&gt;addcoltotals will show up at the end of the row, so if i have multipages, it will now show on the first page&lt;BR /&gt;Why&amp;nbsp; Splunk get &lt;STRONG&gt;1129.3600000000001&lt;/STRONG&gt; from?&lt;BR /&gt;The correct total should be 1129.36&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 01:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671208#M230035</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-08T01:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671241#M230044</link>
      <description>&lt;P&gt;Only addtotals is appended to the end of rows. &amp;nbsp;Have you tried addcoltotals as &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;recommended? &amp;nbsp;If you did, you would have gotten this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="addcoltotals.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28423i4B5C83EBAD717BAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="addcoltotals.png" alt="addcoltotals.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, floating-point arithmetics is always tricky with digital computers. &amp;nbsp;But artifacts usually shouldn't show in such small jobs. &amp;nbsp;Then, again, Splunk is known to be quirky in many computations. (addcoltotals does not have this problem.)&lt;/P&gt;&lt;P&gt;You wanted the total (&lt;SPAN&gt;1129.36) to be rounded up to&amp;nbsp;1130. &amp;nbsp;This can be done after addcoltotals. &amp;nbsp;For example,&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Student, Score
a,153.8
b,154.8
c,131.7
d,115.4
e,103.2
f,95.4
g,95.4
h,93.2
i,93.2
j,93.26"
| table Student, Score
| addcoltotals
| eval Score = if(isnull(Student), floor(Score) + 1, Score)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 09:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671241#M230044</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-12-08T09:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671261#M230050</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;addcoltotals will show up at the end of the row, so if i have multipages, it will now show on the first page&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why&amp;nbsp; Splunk get&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;1129.3600000000001&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The correct total should be 1129.36&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 13:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671261#M230050</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-08T13:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671262#M230051</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;addcoltotals will show up at the end of the row, so if I have multipages, it will now show on the first page&lt;BR /&gt;&lt;BR /&gt;In the real data, I&amp;nbsp; have more than 10, so addcoltotals will not show up on the front page&lt;BR /&gt;&lt;BR /&gt;Why&amp;nbsp; did Splunk get &lt;STRONG&gt;1129.3600000000001&lt;/STRONG&gt;, not&amp;nbsp;1129.36?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 13:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671262#M230051</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-08T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671311#M230067</link>
      <description>&lt;BLOCKQUOTE&gt;Why&amp;nbsp; did Splunk get &lt;STRONG&gt;1129.3600000000001&lt;/STRONG&gt;, not&amp;nbsp;1129.36?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As I already said, floating point arithmetics is messy on digital computers. But Splunk is also known to be quirkier. You can report this as a bug.&lt;/P&gt;&lt;BLOCKQUOTE&gt;In the real data, I&amp;nbsp; have more than 10, so addcoltotals will not show up on the front page&lt;/BLOCKQUOTE&gt;&lt;P&gt;Given that Summary has that bug, you can decide whether to use addcoltotals as a workaround, or live with 1129.3600000000001. SPL doesn't control pagenation. Also, I don't believe Summary offers rounding.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 20:01:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671311#M230067</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-12-08T20:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671657#M230141</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Using addcoltotals&lt;BR /&gt;1) How do I round the score 1129.36 to 1129?&lt;BR /&gt;2) How do I remove No 11, but keep No 1-10?&lt;BR /&gt;See below.&amp;nbsp; Thank you so much for your help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CloudGuy_1-1702436814365.png" style="width: 686px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28473iC4727FE97EEF7877/image-dimensions/686x525?v=v2" width="686" height="525" role="button" title="CloudGuy_1-1702436814365.png" alt="CloudGuy_1-1702436814365.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 03:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671657#M230141</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-13T03:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671803#M230182</link>
      <description>&lt;P&gt;Rounding down is done using floor, as you have tried, but you are adding +1 so it will be 1130&lt;/P&gt;&lt;P&gt;You have row numbers turned &lt;STRONG&gt;on&lt;/STRONG&gt; in the format menu, so you cannot influence row numbers to remove the 11, but you can make your own row numbers by adding this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` Round Score DOWN ```
| eval Score = if(isnull(Student), floor(Score), Score)

``` Now do row processing ```
| streamstats count as Row
| eval Row=if(isnull(Student), null(), Row)
| table Row Student Score&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 21:34:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/671803#M230182</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-13T21:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672036#M230254</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Does the "Score" variable on "eval" pipe always indicate a total Score if applied after "addcoltotals"?&lt;BR /&gt;Thank you so much.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| addcoltotals
| eval Score = if(isnull(Student), floor(Score), Score)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 14:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672036#M230254</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-15T14:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672040#M230255</link>
      <description>&lt;P&gt;The total in your case is calculated by the visualization itself (which means your browser). Apparently the JS which calculates the totals treats all your row values as floating point numbers. And floating number calculations do tend to lead to ugly rounding errors.&lt;/P&gt;&lt;P&gt;You could file a bug on that because it's indeed ugly.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 15:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672040#M230255</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-12-15T15:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672131#M230270</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254242"&gt;@LearningGuy&lt;/a&gt;&amp;nbsp;the eval statement is applied to all events, so based on using the eval if(isnull()... test, that would not do anything if the Student column is non-null. In your case, if you only want to floor() the Score for the total column you would need to do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Score=if(Student="Total", floor(Score), Score)&lt;/LI-CODE&gt;&lt;P&gt;so you ONLY round the Score if it's the Total row&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 00:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672131#M230270</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-18T00:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672202#M230286</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for your help.&lt;BR /&gt;&lt;BR /&gt;I understand now if I want to use Student="Total", I just use the following&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| addcoltotals labelfield=Student label=Total
| eval Score = if(Student="Total", floor(Score) + 1, Score)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;if I leave the label blank, I can use&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval Score = if(isnull(Student), floor(Score) + 1, Score)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 18 Dec 2023 16:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672202#M230286</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-12-18T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to round Totals for Statistics under Format Summary?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672217#M230289</link>
      <description>&lt;P&gt;You are still rounding UP with your floor(Score)+1 - is that what you intended?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 21:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-round-Totals-for-Statistics-under-Format-Summary/m-p/672217#M230289</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-12-18T21:27:32Z</dc:date>
    </item>
  </channel>
</rss>

