Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to not create output when no records

8 - Asteroid

Hi !


I have a workflow with several outputs, and several of these outputs can be empty (no records).


How I can stop the output(s) where I have no record, and allowing at the same time the creation of the other outputs where there is at least one record ?


Thanks a lot !


Kind regards,


20 - Arcturus
20 - Arcturus



That was an interesting question to solve.  First, I want to point you to an idea for a programmatic detour.  This would solve the problem in a straight-forward way:


Now for the answer to your post....


Step #1: Create a field called NULL and fill it with a formula NULL()

Screen Shot 2017-02-14 at 8.04.51 AM.png

Step #2: Include NULL as part of the file/table name in the output configuration.  Uncheck the field (not to keep it in output).

Screen Shot 2017-02-14 at 8.09.11 AM.png


This will prevent the output file from being created (No error message is created) when 0 records are present and will create a normal output file when data is present.


Happy Valentine's Day,


Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
8 - Asteroid

Thanks a lot, it works !


Have a nice day.

7 - Meteor

Hi Mark,


The solution worked. Thanks. I have a follow-up question on this. I have a workflow that I execute prior to a data load for quality check and within this workflow I write to a single output file say "QC_Report.xlsx" but several tabs and I used the option as suggestion by you. I have the output option as "Overwrite Sheet (Drop)". This works. However, if the output file had data written to a tab "Missing Definitions" from a prior workflow run and during the current load there are no records to be written, then the empty tab will remain in the output file.


If the file name does not change with each workflow run but I want no empty tabs, how would i go about it? If I don't want to change the file name in every output tool, how can I generate a new output file using a formula tool and still be able to use the new file name along with the "Null" option for the suffix?




5 - Atom

This is awesome! Great trick!

7 - Meteor

6 - Meteoroid

Hi Mark,


I have the exact opposite problem, where I want to write a file with no lines of data but am taking the file name from the data. I can create a null row and append my file name to it, but this results in a written file with one (albeit empty) row.


Do you know a way to write a blank, dynamically-named file?




8 - Asteroid

I think this is my exact problem, too, Stuart.


I have a series of datasets that need to be cleaned and written to files. Each file MUST exist for validation purposes. But because of some nuances with the platform that imports the data following the cleaning, empty datasets need to be output as empty/blank (dynamically-named) files or, in certain circumstances, files with only a header row.


But I can't get Alteryx to write a file if the dataset is empty.

5 - Atom

Worked like a charm! Thank you!

6 - Meteoroid

Excuse my ignorance but where do we create the field?