Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Create column using field name from another column

mb1824
9 - Comet

I have one column of data - the column name identifies the month/year the data corresponds to. 

 

How do I create another column with one unique value, being the field name of the first column? 

4 REPLIES 4
jrgo
14 - Magnetar

@mb1824

 

you can use a Field Info tool (Developer category) to generate a list of all your field names. Since your table only has one, you can simply Append (Join category) the name to your existing table.

 

If this misses the mark, please share an example of what your desired output should look like.

 

Best,

 

Jimmy

mb1824
9 - Comet

UPDATE: I found a solution to the below. I changed the options on the Source Data Template so it assumed Row 1 was data and then used a multi-field formula to generate a new column. 

 

@jrgo thanks for your help, that works nicely.

 

However, now I have done it for one tab in one file, how do I achieve the same for multiple tabs in one file? Each tab has one column with a different column name (each tab is one month of data).

 

I have a dynamic input tool to merge the data from all the tabs together, but I end up with one column with the field name from the tab I chose as the Source Data template in the dynamic input tool

jrgo
14 - Magnetar

@mb1824

 

Glad to hear you found an alternative!

 

I was actually going to suggest a batch macro because I was thinking you wanted each sheets placed side by side instead of all in one column. But if all in one column, yes, that’s the ideal solution!

 

Not sure how what your expressions looks like in your MultiRow tool to have it know when it needs to get a new header vs copy the previous, but if you also configure your Input tool to output the FULL PATH as a field, you can use that as a grouping field to ensure it resets correctly.

mb1824
9 - Comet

I used this (the column names start with "00", the real data starts with something else

 

Alteryx_multi-row formula.JPG

Labels