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,
Olivia
Solved! Go to Solution.
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:
https://community.alteryx.com/t5/Alteryx-Product-Ideas/Programmatic-Detour/idi-p/12763
Now for the answer to your post....
Step #1: Create a field called NULL and fill it with a formula NULL()
Step #2: Include NULL as part of the file/table name in the output configuration. Uncheck the field (not to keep it in output).
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,
Mark
Thanks a lot, it works !
Have a nice day.
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?
Thanks,
Aruna
This is awesome! Great trick!
What if the output is Tableau Server Data source?
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?
Thanks,
Stuart
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.
Worked like a charm! Thank you!
Excuse my ignorance but where do we create the field?