Splunk Cloud Platform

Avg of column with case statement

Splunkerninja
Path Finder

Hi,

I want to find the grade based on my Case condition but my query is not working as expected.

| eval Grade=case(Cumulative=1,"D", Cumulative>1 AND Cumulative<=1.3,"D+")]

Example: My Grade should be based on the avg(GPA) If Avg(GPA) is 1 Grade at the bottom (Avg Grade)should be D , If it is between 1-1.3 then it should be D+

 

Splunkerninja_0-1701177073877.png

 

 

Labels (2)
Tags (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Shouldn't your eval be something like this

| eval Grade=case(GPA=1,"D", GPA>1 AND GPA<=1.3,"D+")]

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Shouldn't your eval be something like this

| eval Grade=case(GPA=1,"D", GPA>1 AND GPA<=1.3,"D+")]

Splunkerninja
Path Finder

@ITWhisperer 
 I want display the Grade based on the avg GPA and the below condition is not giving the result

| eval Grade=case(GPA=1,"D", GPA>1 AND GPA<=1.3,"D+")]

Splunkerninja_0-1701183698945.png

 

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your value (3.17) isn't covered by any condition in your case function which is why you don't have a grade. What are the ranges for your grades?

0 Karma
Get Updates on the Splunk Community!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...