Hi there,
Im trying to display the data values in percentage. How can i do it?
Thanks
you want Correct
to be %Correct=(Correct/(Correct+Wrong))
for example?
try this:
index="cyber_wellness" sourcetype="csv"|chart count over Stage by CorrectAns
|eval %Correct=round((Correct/(Correct+Wrong))*100,2)|eval %Wrong=round((Wrong/(Correct+Wrong))*100,2)
|fields Stage %Correct %Wrong
you want Correct
to be %Correct=(Correct/(Correct+Wrong))
for example?
try this:
index="cyber_wellness" sourcetype="csv"|chart count over Stage by CorrectAns
|eval %Correct=round((Correct/(Correct+Wrong))*100,2)|eval %Wrong=round((Wrong/(Correct+Wrong))*100,2)
|fields Stage %Correct %Wrong
You may be able to achieve this using the eventstats command.
See https://answers.splunk.com/answers/9660/stats-count-as-a-percentage-as-the-total.html for an example.