Alteryx Designer Desktop Discussions

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

Create Columns next to original columns

rajatjain1
8 - Asteroid

I have data like

 

 

 

    a      b      c

1  0      0      0 

2   0     0      0 

3   1      1     1

 

 

I want new columns added for every column 

     a     ref-a    b     ref-b      c     ref-c

1  0       null     0     null        0      null

2  0       null      0     null       0      null

3  1       null     1      null       1      null

 

I tried multi field and the fields were created but they were created all at the end of all columns. I want new columns simultaneously and do not want to reorder since in actual I would be dealing with over 500 columns.

 

Thanks:)

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @rajatjain1 

 

Here is a workflow for the task.

 

Output: dynamically creates column ref after a column

atcodedog05_0-1602610154443.png

 

Workflow:

atcodedog05_1-1602610057176.png

 

Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

porter_samu
6 - Meteoroid

@rajatjain1 could you use the Multi-Field Formula tool to create a new field for each column with "a_ as a Suffix"?

1.png

Once you have all the columns created, you can use a Select Tool to go to Options> Sort > Sort on Field Name> Ascending. 

2.png

grazitti_sapna
17 - Castor

HI @rajatjain1 , give this a try but remember that the matrix should be n*n like in your example you took 3*3 matrix. It is dynamic workflow.

 

Matrix you provided

 

grazitti_sapna_0-1602667195125.png

 

My Tested matrix.

grazitti_sapna_1-1602667233556.png

 

If this is what you are looking for kindly mark this post as solution.

Thanks.

 

 

Sapna Gupta
Labels