All Apps and Add-ons

How to give Ranks to the employees based on the points

yu94
New Member

Hi All,

Basically what I'm trying to do here is there will a data as below
This is the sample data(The real data may be any numbers and the employees also any nymbers)
Employee1 Points Rank
Ram 1100 1

Girish 570 2
Mahesh 500 3
Lalith 500 3
Tanvie 200 4
Raj 100 5
Vishal 100 5
Yogee 100 5

so I want to write a splunk search to give the Ranks to the employees based on the Points.
Can you please help me to write this splunk search?

Regards,
Thippesh

0 Karma
1 Solution

dineshraj9
Builder

Do it this way -

< your search > | streamstats current=f window=1 last(Points) as prevPoints | fillnull value=0 prevPoints | eval tempRank=if(Points=prevPoints,0,1)  | streamstats sum(tempRank) as Rank | table Employee1 Points Rank

View solution in original post

0 Karma

dineshraj9
Builder

Do it this way -

< your search > | streamstats current=f window=1 last(Points) as prevPoints | fillnull value=0 prevPoints | eval tempRank=if(Points=prevPoints,0,1)  | streamstats sum(tempRank) as Rank | table Employee1 Points Rank
0 Karma

yu94
New Member

Thanks Dinesh... it worked as expected.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...