Upgrading Server to version 22.1? We’ve enabled the faster AMP engine by default. Read about how these system settings changes might affect you.

We’re aware of an intermittent issue with our My Alteryx login and are actively working to have the issue corrected. If you run into an error when logging in, please try clearing all cookies or accessing the community on a different browser. Thank you for your patience!

Alteryx Designer Discussions

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

Converting first row of data into column(Field) names

mjh418
8 - Asteroid

Hi All,

 

The source file that I use for the workflow has column(field) names that are NOT fixed and may change depending on what the user is trying to extract. 

Because I don't want to hard code these and the user can't manually change the source file, I intentionally import it in a way that the field names become first line of DATA and the Field names are automatically populated as F1, F2, ... and so on (Please see below). This way I can manipulate the first line of data into a workable fixed field name by putting through some conditions first. 

 

My question is after I have dynamically renamed the first row of data into desired column/field names, how do i move (replace those F1,F2s) those into actual column names? If you can attach example/workflow, it would be greatly appreciated.

 

Please see below for example.

 

F1F2F3F4
FieldName1Fieldname2Fieldname3Fieldname4
1222177

 

Desired Outcome:

FieldName1Fieldname2Fieldname3Fieldname4
1222177
xxxxxxxx

 

Thank you so much for your time. 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @mjh418 

 

This can be easily done using dynamic rename tool and option take field name from first row.

 

Workflow:

atcodedog05_0-1626258204816.png

 

Hope this helps : )

mjh418
8 - Asteroid

@atcodedog05 wow thank you so much!

 

Sorry if I may bother you one more time, before all this, how can i take ONLY the FIRST ROW(to be fields) and turn that row into a single column?

[Field name]
Fieldname1
Fieldname2
Fieldname3
Fieldname4
atcodedog05
22 - Nova
22 - Nova

Hi @mjh418 

 

You can configure dynamic rename tool to "Take Fields from first row" refer the yellow highlighted in the image. This will take the first row as column names.

 

Labels