We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer 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

16 REPLIES 16
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. 

Labels