Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.
SOLVED

ouput file only if there are records

Highlighted
6 - Meteoroid

Hi all,

 

I'm using output csv file to provide the data steward with a quick view on any missing mappings etc... So in the flow I have a branch with conditionals and aggregators to identify erroneous/missing values, then output that to csv on a designated place. The data steward reviews these files and knows what to do.

 

However, the csv is generated even when there are no records. Is there a way to prevent creating the empty csv ?

 

Thanks!

 

kind regards

Jay

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hey @Jay45,

 

How about this:

  1. Use a FORMULA to create a "filename" field.
    if IsNull([Required Data Element]) THEN '' ELSE 'FileName.csv' Endif
    if a required field is NULL, then put blank in filename otherwise use your filename (could be a constant).
  2. Output using "Take File/Table Name" and remove the field from your output

If the name is blank, Alteryx won't output.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
ACE Emeritus
ACE Emeritus

I just wanted to add on a little more to @MarqueeCrew's answer.

 

If you set up a formula with a filename, and modify your output data tool to "Take file/Table name from field", then if there are no records passed through, alteryx will not create any files.  That should skip the need for a "required data element", based on your use case.

Basically, I think you could modify step 1 of the prior answer to a Formula of

'FileName.csv'

based on your example

6 - Meteoroid

Marked as solution because it was slightly more accurate than MarqueeCrew's answer.

 

I wish this behaviour of NULL filename was better documented...

 

But thanks to both!

Labels