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

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

Developer Spotlight with Brett Adams

In our third Spotlight feature, we're excited to shine a light on Brett—a Splunk consultant, innovative ...

Index This | What can you do to make 55,555 equal 500?

April 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...