Dashboards & Visualizations

result combination

lostcauz3
Path Finder
ORGMonthKPI_1KPI_2KPI_3KPI_4
firstSep21100NANANA
firstSep21NA100NANA
firstSep21NANA100NA
firstSep21NANANA100


how do i convert the table above  to get  the table below:

ORGMonthKPI_1KPI_2KPI_3KPI_4
firstSep21100100100100
Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| foreach KPI_*
  [| eval <<FIELD>>=if(<<FIELD>>="NA",null(),<<FIELD>>)]
| stats values(*) as * by ORG Month

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| foreach KPI_*
  [| eval <<FIELD>>=if(<<FIELD>>="NA",null(),<<FIELD>>)]
| stats values(*) as * by ORG Month
0 Karma

lostcauz3
Path Finder

thanks for the suggestion this is working but there is something with my data that i am missing i guess that's why extra "NA" is being added to the fields containing 100.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could something like instead

| eval <<FIELD>>=if(match(<<FIELD>>,"NA"),null(),<<FIELD>>)

but at the end of the day, you have access to your data and can find out what's really going on.

0 Karma

lostcauz3
Path Finder
ORGMonthKPI_1KPI_2KPI_3KP_4
firstSep21100
NA
100
NA
100
NA
100
NA

 

output is coming like this for the above query you mentioned

0 Karma

lostcauz3
Path Finder

this is happening after stats values(*) as * by ORG,MONTH.

any way i can delete the multivalues of these fields that is NA @ITWhisperer 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Anything that is NA should have been set to null() by the foreach command, so anything that is left should not be NA but somehow something else. You need to examine these more closely to figure out why they are not being set to null(). For example, is there a trailing space? or is it N/A? etc.

0 Karma

lostcauz3
Path Finder

thanks a ton,

Solved it!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Here is a runanywhere example showing it working

| makeresults
| eval _raw="ORG	Month	KPI_1	KPI_2	KPI_3	KPI_4
first	Sep21	100	NA	NA	NA
first	Sep21	NA	100	NA	NA
first	Sep21	NA	NA	100	NA
first	Sep21	NA	NA	NA	100"
| multikv forceheader=1
| table ORG Month KPI*
| foreach KPI*
    [| eval <<FIELD>>=if(<<FIELD>>="NA",null(),<<FIELD>>)]
| stats values(*) as * by ORG Month

This probably means your real data does not match your example data closely enough.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...