Dashboards & Visualizations

Additional column with values based on existing column values

anmohan0
Explorer

Hi,

I am displaying a table as a result from the Search, however I would like to add an additional column with static values based on the existing column. For example,

S.No    Name    Dept

1          Andy      IT

2          Chris      Bus

3          Nike        Pay

 

In the above table, I would like to add another column called Company and map value based on Dept column as below
If Dept is IT, then the value for Company as XXXX

If Dept is Bus, then the value for Company is YYYY

If Dept is Pay, then the value for Company is ZZZZ and the final table should look like

S.No    Name    Dept    Comp

1          Andy      IT           XXXX

2          Chris      Bus       YYYY

3          Nike        Pay       ZZZZ

 

@ITWhisperer Dashboard 

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval Comp=case(Dept=="IT","XXXX",Dept=="Bus","YYYY",Dept=="Pay","ZZZZ")

View solution in original post

0 Karma

anmohan0
Explorer

Thanks for the quick help and it did save my day!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval Comp=case(Dept=="IT","XXXX",Dept=="Bus","YYYY",Dept=="Pay","ZZZZ")
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...