Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

How to not create output when no records

olivia_paquot
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,

Olivia

17 REPLIES 17
rpenatez_dup_538
5 - Atom

Hi Robin,

 

You need to use a Formula tool to create new fields 😉

arvindhbhujang
5 - Atom

Excellent solution.

Thanks a lot. Its worked for me.

DataBob
5 - Atom

Mark, Thanks for a simple solution that works!  Do you happen to know why it works?  Do formulas not return a result when the input is empty?

ngarrepa
5 - Atom

Hi 

 

will this work even if i write to an sql table? 

 

I have a workflow with two outputs and writes to same table. If condition is true, work flow will run a pre-sql step and writes data to table A. If condition is false workflow will run a different pre-sql query writes data to same table A. I am trying to prevent running pre-sql query and write to table if one of the conditions has 0 records.

 

Appreciate your help.

 

nik

ak2018
8 - Asteroid

add a formula field before the output. That worked for me.

ngarrepa
5 - Atom

@ak2018 

What kind of formula?

ak2018
8 - Asteroid

Use the Fomula Tool, create a field and name it NULL. Change the type to String and type NULL() in the formula space. That should do it. And in your Output Tool, indicate to get the "table name" from this field and not to include it in the output. 

NaomiMariaThomson
7 - Meteor

Hi Robin,

 

The field can be created using a Formula tool or a Multi row formula tool and it can be added right at the end before the final output.

 

Regards,

Naomi

Labels