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!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

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

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...