Dashboards & Visualizations

Visualize fields as percentage in pie chart

harryvdtol
Explorer

Hello,

I have 3 rows with numeric data, trying to visualize this in a pie chart.

The first value (totalval) is the total value
I want to the other values to be a percentage of the total value and so only show the 2 other values (typeA and typeB)

type           total
---------------------
totalval    4151
typeA       1442
typeB        17

Trying for some hours, i am stuck, any help is appreciated

Regards,

Harry

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval totalval=if(type="totalval",total,null())
| eventstats values(totalval) as totalval
| where type!="totalval"
| eval percent=100*total/totalval

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval totalval=if(type="totalval",total,null())
| eventstats values(totalval) as totalval
| where type!="totalval"
| eval percent=100*total/totalval
0 Karma

harryvdtol
Explorer

Very impressive and educational.

Thank you.

Regards,

Harry

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...