Alteryx Designer Desktop Discussions

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

Adding Text to column

julianhoetzel
8 - Asteroid

Hi there, 

 

every time when I add a new client I would like to add three repeating words/text in the associated columns. Example (date is dd-MM-yy):

Date

ClientAmount AAmount B
01-01-21 ABC1010
01-01-21XYZ2030
02-01-21ABC1010
02-01-21XYZ3030
03-01-21ABC1010
03-01-21XYZ4040
03-01-21EFG100100

 

Output is supposed to look like:

DateABC_Amount AABC_Amount BXYZ_Amount AXYZ_Amount B
01-01-2110102030
02-01-2110103030

 

If a new client joins the list on 03-01-21 (see first Table), say "EFG", the new client shall be added the very right end of the list with the same structure as the other clients

 

DateABC_Amount AABC_Amount BXYZ_Amount AXYZ_Amount BEFG_Amount AEFG_Amount B
01-01-2110102030  
02-01-2110103030  
03-01-2110104040100100

 

 

Could anybody help me to automatize with an endless adoption of new clients?

Thanks in advance 🙂

 

Julian

2 REPLIES 2
Luke_C
17 - Castor

Hi @julianhoetzel 

 

The transpose and crosstab tools can help achieve this. This solution should work for new additions down the line with no updates needed.

 

  1. First I transpose the data to get all the amounts in one column
  2. Then I concatenate the client and amount name
  3. Then cross-tab that data back to have the clients/amounts as columns.

 

Luke_C_0-1622555143368.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @julianhoetzel 

 

Here is how you can do it.

 

atcodedog05_0-1622555199919.png

 

1. Using transpose tool convert amount columns to rows.

2. Using formula tool creating new column names.

3. Using cross tab convert back to table.

4. Using dynamic rename i using previous name to change the crosstab name.

 

Hope this helps 🙂 

Labels