Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Switching output files base on records or no records

Mari1
6 - Meteoroid

I need to generate an excel monthly report which should  be presented in different format when there are records (returns), or there are not records (no returns). For instance:

  • If there are records (after transformations) the report should have the column names and data rows, as shown in the "Returns" sample output file attached
  • If there are no records (returns), the report should look like the "Return no records" file (showing only an statement)

I have generated both files in Alteryx, and wonder if there is a way where the workflow will output only the corresponding file based on records/returns or not records criteria. Therefore, when the workflow is run, it will generate only either the "Returns file"  or the "Returns no records" file

WF.PNG

4 REPLIES 4
Mathias_Nielsen
9 - Comet

Hi @Mari1,

 

Try this concept i attached. Here you append the count to your records. Then further downstream the filter will only send something to output 1 if there is records (Count != 0) and records will only go to output 2 if there are no records (Count = 0). There is a select tool after the filter to remove the count and field 1 column, so that this doesn't get included in the final output. We need field1 as a dummy record, this allows the flow to run even when there are no records from the input. 

I hope this helped you :)

Warcry
7 - Meteor

What I have done in the past is use the email to indicate no results found or something like that and when there were results a excel file was in the email. Would that be more efficient, I could walk you through it? 

Mari1
6 - Meteoroid

Thank for your response. Ideally, I'd like to end up with only one file filled up. I'm not able to see the configuration of your output file, was that it intended to write on the same file?

nagakavyasri
12 - Quasar

@Mari1 Try if the below works:

 

Screenshot 2024-12-03 153650.png

Labels