Alteryx Designer Desktop Discussions

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

Tranposing multiple columns with String and Numeric Values

jackdaniels
8 - Asteroid

I have been trying to reshape the following using Transpose / Formula, but I can't do it as I am mixing strings and numeric values.

 

From this

Dimension  1Dimension 2Category 1Amount 1Category 2Amount 2Category 3Amount 3
RandomWordExport30HR50Cash500
RandomTestImport40Finance60  
SomethingElseTax50    

 

To This

Dimension  1Dimension 2CategoryAmount
RandomWordExport30
RandomWordHR50
RandomWordCash500
RandomTestImport40
RandomTestFinance60
SomethingElseTax50

 

How can I do this?

3 REPLIES 3
tcroberts
12 - Quasar

Hi!

 

I've created a sample workflow for you here:

 

transposemixedtypes.PNG

 

Essentially I transpose using Dim1 and Dim2 as keys, then a MultiRow Formula helps me to create the Category field you're looking for. I then remove all fields where [Value]=[Category], and get your desired output.

 

 

Let me know if this helps,


Cheers!

jackdaniels
8 - Asteroid

Interesting solution - thanks!

 

I haven't seen nested IF statements like that either. All good.

tcroberts
12 - Quasar

Yea, there are more concise ways to write nested IF statements if you need, like ELSEIF, or if there are many conditions, a switch statement.

 

I just find it easier to use the more verbose method when writing solutions. as it is easier for me personally to follow the logic, provide explanations, or identify any issues with it.

 

In general, the ELSEIF or SWITCH() syntax is probably better to use for production though.

 

Glad I could help (:

Labels