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.
SOLVED

Header Rows before Field Names in Multiple CSV Outputs

amazz24
7 - Meteor

Hi All,

 

I built a workflow that adds header information above field names in my output, using this post as a reference:  https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Need-Header-Row-Before-Column-Names/td...

 

However, I need to take this solution one step further by breaking out the data into multiple CSV files based on a certain criteria in my data.  To achieve this, I selected the option to 'Take File/Table Name From Field' in the output tool. However, by doing so I found 2 issues with the output files:

 

Issue 1 - The information that I added in the Text Input tool only appears in the first CSV file.  All other files only contain data (with field names if I selection option 4 in the output tool "First Row Contains Field Names" or without field names if I deselect that option).

 

Issue 2 - Deselecting option 4 in the output tool, which was recommended in the post that I referenced above, makes the Field Names disappear completely from all output files.  Selecting this field pushes the field names above the information in the Text Input tool in the first output file.  All other files will have field names and data directly under them.

 

For some additional background information on the workflow, please note that I am writing to CSV files so that I can maintain physical formulas in excel and the workflow is generating 100+ files which need to have the same information (headers, field names, formulas, etc.).

 

Any assistance with this would be greatly appreciated!

2 REPLIES 2
DanielBr
Alteryx
Alteryx

Hi @amazz24 

 

I don't think you will be able to take this post one step further by using the option "Take File/Table Name From Field".

 

Instead, I might recommend using a batch macro to dynamically break the data into multiple CSV files. Check out this article for Getting Started with Batch Macros.

 

In your case, the field that determines which .CSV file the data belongs to, will be you input to the Control Parameter for the Batch Macro.

 

If this solves your problem, please mark this as the solution.

amazz24
7 - Meteor

Hi @DanielBr

 

Thanks for this suggestion!  I think it will work based on what I have read regarding batch macros.  However, I do not have enough experience with using macros and I am having some trouble understanding what needs to be done.  The last tool before my output in a Union that pulls in the custom header information, field names, and the actual dataset.  Do I need to add the Control Parameter tool to the union or the output tool?

 

Thanks!

Labels