Getting Data In

How to create new column with percentage?

SS1
Path Finder

Hi,

My search is giving below output,

Month  FieldA    FieldB
Jan         285      1410
Feb         247      1934
Mar         215      2197

Can we create a new column with FieldA% and FieldB%, below is the example

Month  FieldA    FieldB   FieldA% FieldB%
Jan         285      1410        20%           80%      
Feb         247      1934         22%          78%
Mar         215      2197         15%           85%

Eventually i will only be using Month and FieldA% in a column chart

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use eval to compute the percentage

| eval FieldApct = (FieldA*100)/(FieldA + FieldB)
| rename FieldApct as "FieldA%"

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...