All Apps and Add-ons
Highlighted

how to calculate percentage for each category

Path Finder

Hi all,

i want to calculate and display percentage for each category not the records, based on below search , i can get the result of records number, but i want to display as percentage, could you pls kindly let me know how to calculate? Thanks

**|stats count as count by Q |addtotals col=t row=f labelfield="Q" label=all

result:
Q count
A 220
B 387
C 228
D 247
E 268
all 1350

0 Karma
Highlighted

Re: how to calculate percentage for each category

Path Finder

i have fixed the problem by below search:

*| eventstats count(Q) as total |stats count as count by Q total|eval percent=round(count/total100,2) |table Q,percent

thanks.

View solution in original post

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.