Start Free Trial

Alteryx Designer Desktop Discussions

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

Conditionally write output files to different folders based on the number of records

ckaushik001
6 - Meteoroid

Hi, 

I am working on a reconciliation process where we use 50+ text files as input (using directory tool) to do some reconciliation. The reconciliation process has been built and working fine. The new requirement is if the output contains zero records (means no reconciliation issues), it should be written to a different folder with "_none" suffix in the file name. And if the output has more than zero (0) records (means reconciliation issues), it should be written as usual in the designated folder in network drive.

Important: We have to write the output in different folders based on the number of records. We should not first write the output file and then read it again to build the rest of the process.

 

Records = 0, Output File Name: "FileName_DateStamp_none.xlsx"

Records >0, Output File Name: "FileName_DateStamp.xlsx"

 

I would appreciate if you could point me in the right direction please. Thank you! 

4 REPLIES 4
Alayna
8 - Asteroid

Hi - It sounds like you could use the Count Records tool under the Transform tab. I'm not sure how your data is formatted, but I'm assuming you could pass your data stream to the Count Records tool and use a filter based on zero or more records (rows).

grazitti_sapna
17 - Castor

@ckaushik001 , you can try using Count Records tool or Summarize tool under Transform tab. If it does not work then please share some sample input and your desired output so that I can share a complete workflow.  

Sapna Gupta
ckaushik001
6 - Meteoroid

@Alayna , thank you Alayna! This looks okay, however, the workflow will generate 2 files at each run. Even if the number of records are not zero, it will write one file with zero records.

We must have only one output written, based on whether there are zero records or more. Is there any way, we can stop/block the output in one of the filter stream based on the number of records? Or maybe we can switch the output based on number of records?

 

thank you!

Podoseb0
7 - Meteor

Not completely sure how your workflow is going to work, but I changed a few things on @Alayna's solution. Check the attached and let me know if this works for you.

Labels
Top Solution Authors