I have a search that pulls values for 5 fields, some of which have a value and some that are null. I would like to create a new column ("totalrev") that counts the number of non-null values.
| inputlookup foo
| search field1=* OR field2=* OR field3=* OR field4=* OR field5=*
| table field1, field2, field3, field4, field5, totalrev
How do I get a number into the "totalrev" column that will count the number of non-null values found in fields 1 - 5?
I think you would get it using the following statement above your table
eval totalrev=mvcount(mvappend(field1,field2,field3,field4,field5))
I think you would get it using the following statement above your table
eval totalrev=mvcount(mvappend(field1,field2,field3,field4,field5))
Yes! That's what I needed - thank you so much!