Reporting

How do I replace null value in Pivot?

juzzbitzz
New Member

I have a pivot table that has a null value for a few of the records in the "Date" column that is preventing me from sorting the table. How and with what do I replace the null value in the Date column?

Tags (2)
0 Karma

woodcock
Esteemed Legend

You have 3 options:

...  | eval Date = coalesce(Date, yourAlternateFieldHere, "Your Hard-Coded Default Value Here")

OR

...  | fillnull value="Your Hard-Coded Default Value Here" Date

OR

...  | filldown Date

I leave it as an exercise for the reader to figure our (or @DalJeanis to explain) the differences.

0 Karma

DalJeanis
Legend

You need to populate the Date field.

Identify, on the records with no Date, what is a good candidate for substitution, then do something like

| eval Date = coalesce(Date,mySubstituteField)  
0 Karma

renjith_nair
Legend

@juzzbitzz,

Try adding |fillnull value="your value for date" Date in the base search before aggregation/sort

Happy Splunking!
0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...