Dashboards & Visualizations

How can I round percentage values in a piechart?

tamduong16
Contributor

I have the following piechart:
alt text

How can I change it so that the percentage could be round from 33.771% to 34%? And for the rest also?

0 Karma

jkat54
SplunkTrust
SplunkTrust

Use eval’s round function in your search:

...| eval numberField=round(numberField,0) 

The above would round a field called numberField to whole numbers, you could change 0 to however many decimals you want to round to.

DalJeanis
Legend

@tamduong16 - One suggestion - you probably want to round to 1 digit after the decimal. It won't be too distracting to the user, and it will avoid questions when the numbers often add up to more than 100.

Most people don't pay attention to adding up decimals, and even if the numbers add up to 100.1 or 100.2, it's less likely to raise questions than a total of 101 or 102. (33.8/42.5/23.7 vs 34/43/24)

0 Karma

tamduong16
Contributor

thanks for the advise DalJeanis

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

This might help. You simply round the values in your SPL query.

Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...