Alteryx Designer Desktop Discussions

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

Creating and naming new columns dynamically

MarkoT
5 - Atom

Hello,

 

I have data like this:

IDYearValue1

Value2

120161216
220173284
320164336
42016352

 

I'm trying to make scheduled workflow that creates a wide table from this data dynamically. The result should look like this:

IDValue1_2016Value1_2017Value2_2016Value2_2017
112 16 
2 32 84
343 36 
435 2 

 

In future the year column will get new values, so when this happens the workflow should automatically create new columns "Value1_2018" and "Value2_2018".

 

I'm pretty lost where to start. Is this possible in Alteryx and how?

3 REPLIES 3
PaulN
Alteryx Alumni (Retired)

Hi @MarkoT,

 

Thank you for posting.

 

So, looking at your data set, I would say that you need to

 

- reshape your data so you could easily access "Year" and "Name" for each "Value" [Transpose tool]

- based on previous, generate new headers that will look like a string made of "Name", "_" and "Year" [Formula tool]

- reformat the data to use the newly computed header [Cross Tab tool]

 

As an example:

 

 

 

example.png

 

Hope this helps!

 

Thanks,

 

Paul Noirel

Customer Support Engineer, Alteryx

 

MarkoT
5 - Atom

Thank you Paul, that is exactly what I was looking for!

PaulN
Alteryx Alumni (Retired)

You are very welcome @MarkoT :)

 

Paul Noirel

Customer Support Engineer, Alteryx

 

Labels