Splunk Search

Issue in Splunk round function

keerthana_k
Communicator

Hi

I have a timechart where I am displaying 4 values as a percent. My search query is like this:

.......| eval Percent1=Count1*100/(Count1+Count2+Count3+Count4)  | eval Percent2=Count2*100/(Count1+Count2+Count3+Count4)  | eval Percent3=Count3*100/(Count1+Count2+Count3+Count4)  | eval Percent4=Count4*100/(Count1+Count2+Count3+Count4)  | timechart partial=false span=1h first(Percent1) as Percent1 first(Percent2) as Percent2 first(Percent3) as Percent3 first(Percent4) as Percent4 

I am using stacked area chart to display these values. Ideally, the total of all the Percent values should be 100. But I am getting 100.000001 or 99.999999 as the total. I tried rounding the values to two decimal places but 100.000001 is rounded off to 100.01 and 99.999999 is getting rounded off to 99.99. Can anyone tell me why this happens? How do I overcome this?

Thanks in Advance

Tags (1)
0 Karma

kristian_kolb
Ultra Champion
0 Karma

keerthana_k
Communicator

Hi. Thanks for your help. But I am still facing the same issue.

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...