If my search result has any count I want to append my search with OUTPUTCSV command else null.
Something like if Job.resultCount > 0 add Outputcsv command to query else null.
will something like this work:
| appendpipe [ stats count | where count==0 |outputcsv]