Alteryx Designer Desktop Discussions

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

File Always Being Written Regardless of the Filter

artzee1556
8 - Asteroid

I am trying to add a branch to my alteryx workflow that writes out a file only if the results of a predecessor step [a record count] equals 0. But for some reason it ALWAYS writes out the file regardless of the predecessor results. The branch is illustrated n the attached. I have a filter at the beginning of the branch that should block the creation of the file when the record count is NOT 0, but it doesn't matter. It ignores the filter and always write out a file. Any help would be GREATLY appreciated. Thanks.

4 REPLIES 4
JosephSerpis
17 - Castor
17 - Castor

Hi @artzee1556 you may find this post helpful.

artzee1556
8 - Asteroid

Thanks so much Joseph for the quick response but the solution I was looking for is the exact opposite of the one in the post you recommended. My requirement is to output a file only when the record count is 0 and the file that is output in this case only contains headers (no data). If the record count is > 0 then NOTHING is output. I've spent hours on this trying to rewire my code 10 different ways and just can't get this to work. Depending on how I code the logic in the branch I attached as an illustration, Alteryx either doesn't output anything under any circumstance or always outputs something. Seem to simple.  I can't use detours because this isn't an interactive app. AT least I don't think I can. 

afv2688
16 - Nebula
16 - Nebula

Hello @artzee1556 ,

 

I have created a little workflow that simulates what I think is what you desire. Using a batch macro, you can select if you either want the records to be written or not, depending on the row counter:

 

Untitled.png

 

Its the same macro. As you can see, the one that has rows (1 row), will have no output.

 

On the other hand, the one that has 0 rows will output the file.

 

Hope it helps 🙂

 

Regards

artzee1556
8 - Asteroid

Hello afv2688 -

 

Sorry I did not get back to you earlier. I have been slammed and FINALLY got a chance to look at your solution today. IT WORKS PERFECTLY. Thanks so much for the xtra brain sweat and for helping me out with this. It has been a challenge to me for months! Sincerely, Art

Labels