Free Trial

Alteryx Designer Desktop Discussions

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

Prevent phantom records with no data from being written

adm510
11 - Bolide

I have a simple macro that is pulling data from a cloud source, table by table, and stores the data in separate Excel file for every table.  As you can see in the screenshots, some tables have 0 records, but Alteryx still creates an Excel file. Is there any logic I can put in my macro to prevent this? The problem is, I don't know how to check for 0 records.

 

 

 

0 records.png0 records macro.png

6 REPLIES 6
MarkEugene9000
7 - Meteor

Hello,


Could you put a filter tool (results in two streams, true and false). The filter criteria is to identify a set of data with blank/null row(s), if true, no further steps added to the 't' stream, if false, draw a connection to the 'f' stream to your output?


Mark

adm510
11 - Bolide

Thanks @MarkEugene9000 I tried this but but it didn't work. I think the action statement connected to the output component is forcing a new file, even when there is no data.

MarkEugene9000
7 - Meteor

I tried a local batch macro with approx. 40 files - read them in, spit them out in .csv. One of them I manually deleted all my data from. That file did not get output in my batch macro process, which I believe is the outcome you are looking for.

 

  • When you output, how are you naming the file? Are you using the "take file/table name from field" checkbox on the output data configuration? If so, how is it possibly naming the file of blank data?
  • In your input, do you have headers, or is the 'first row contains data' checked?
  • I guess I'm wondering if you are able to name the files without using the action on the output.

 

Mark

adm510
11 - Bolide

@MarkEugene9000

 

I'm reading in data from a cloud SQL connection.

 

  • I'm renaming the file to match the name of the table.  Look at the screenshot on the initial post, I know you can't see the details, but the control parameter updates both the table name in the SQL connection and the output writer
  • This option isn't available for sql connections
  • Without an action tool, there really isn't a way to dynamically name a file, is there?
Joe_Mako
12 - Quasar

You can use the Message tool configured to "Error - and stop passing records through this tool" and a Parallel Block until done from the CReW Macro Set http://www.chaosreignswithin.com/p/macros.html as in the attached:

 

test write.png

adm510
11 - Bolide

That worked like a charm, thanks!!!

 

I also added the control parameter to the message tool, now when it throws the error, it will tell me which file it skipped.

Labels
Top Solution Authors