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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...