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.
Solved! Go to Solution.
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
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.
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.
Mark
I'm reading in data from a cloud SQL connection.
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:
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.
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |