Since you have used count it will be defaulted to 0 when there are no violations, hence $job.resultCount$ will have one row with the value of 0. Null search swapping through token will work when the search returns no results. For example if you add condition to search for Violations greater than 0 you will get null result or no results found. On top of the same you can use a combination of set/unset and depends and rejects to display/hide section of your dashboard when there are no Violations.
tag=database tag=query action=failure | `find_NULL_fields` | stats count by _time, event_time, event_id, severity, src_ip, os_user, src_app, dest_ip, dest_host, db_name, db_schema, db_user, sql_command, object_type, error_code, action, query | bin _time span=24h | stats count by _time, db_user | where count > 14 | stats count as Violations | search Violations>0
... View more