Start Free Trial

Alteryx Designer Desktop Discussions

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

Static column/row data addition

Grape
5 - Atom

I am trying to modify a 100-row excel input file by adding a new header, "PGM TYPE" and hard code "0001" in every row in this new column. I know you can use the generate rows tool to add a column to an input file but I'm having challenges adding the "0001" value for each row. Any feedback is appreciated - thanks!

4 REPLIES 4
Luke_C
17 - Castor
17 - Castor

Hi @Grape 

 

There are two ways:

 

  1. Formula tool to create field and hardcode "0001"
  2. Append Fields tool (I prefer this when I have to add multiple hardcoded values)

 

Luke_C_0-1658840983514.png

 

Robin_McIntosh
11 - Bolide

Just use a simple formula tool.

Robin_McIntosh_0-1658841056138.pngRobin_McIntosh_1-1658841071734.png

 

Amol_Telore
11 - Bolide

Hi @Grape 

 

It is my understanding that you are trying to add a new column in data and value of this new column will be '0001' for all the 100 records. 

To do this you can use formula tool.

  1. In column names, instead of selecting existing columns select add a new column and enter column name as 'PGM TYPE'
  2. In the expression editor window, enter '0001'. Keep data type as String. If selected as Numeric data type then it will remove starting zeroes.
  3. It will show 0001 value for all 100 records now.
Emmanuel_G
13 - Pulsar

Hi @Grape ,

 

You don't need to use Generate Rows tool. When you use the formula tool. The expression inside is applied to all the rows of your dataset as shown below in screenshoots.

Emmanuel_G_0-1658886820683.png 

Emmanuel_G_1-1658886841021.png

 

 

Labels
Top Solution Authors