Reporting

Eval statement that included AND and OR

Mary666
Communicator

Hello All,

I have been struggling with what seems to be a very simple concept. Can someone please help me correct this eval statement with OR and AND? I would like to display:

if name is in All - in both Department and Station = 0
If name is not in Department =1
if name is in Station =2

I mainly want to get clarity on the structure of my eval statement using OR and AND. 

| eval Name=if(((All=="No" OR All=="Yes") AND Department=="No" AND Station=="Yes"), "0","1", "2")

 

0 Karma
1 Solution

renjith_nair
Legend

Do you have some sample/dummy data with inputs and expected outputs.

It's bit confusing at first glance , for e.g for value=2, what should be the value of Department?

are you looking for something similar to below?

if (Station="Yes", if(Department="Yes",0,1),2)

 

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

Do you have some sample/dummy data with inputs and expected outputs.

It's bit confusing at first glance , for e.g for value=2, what should be the value of Department?

are you looking for something similar to below?

if (Station="Yes", if(Department="Yes",0,1),2)

 

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...