Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Cross tab with strings

Arg0n11
6 - Meteoroid

Hi All,

 

How would I go about doing both of the below:

 

1. How would I convert table (1) to the format shown in table (2)

 

Table (1)

TermDefinition
USDUS Dollar
AUDAustralian Dollar
ZARSouth African Rand

 

Table (2)

Term 1Definition 1Term 2Definition 2Term 3Definition 3
USDUS DollarAUDAustralian DollarZARSouth African Rand

 

2. How could I then add columns after Definition 3 in table (2) to get to specified number of columns, say 5, as per below. I am asking this as the number of definitions and terms could differ for each run but need set columns for my tool to work

 

Term 1Definition 1Term 2Definition 2Term 3Definition 3Term 4Definition 4Term 5Definition 5
USDUS DollarAUDAustralian DollarZARSouth African RandNullNullNullNull
5 REPLIES 5
ImadZidan
12 - Quasar

Hello @Arg0n11 ,

 

here is an idea. Hope it helps or at least give you an idea.

HomesickSurfer
12 - Quasar

Hi @Arg0n11 

 

See attached.  It works, yet I got the sort order of fields reversed.

Capture.PNG

Arg0n11
6 - Meteoroid

Thanks! This works as well as the other option provided by @HomesickSurfer.

 

One follow up though. I see you added the blank columns but how would the solution change if you didn't know the original amount of terms and definitions. So let's say the input was 2 terms and definitions, rather than 3, how would you make it add blank columns to 5 anyway?

Arg0n11
6 - Meteoroid

Thanks for this. Do you know how to solve the second part of my question with the blank columns?

ImadZidan
12 - Quasar

Hello @Arg0n11 ,

 

You are correct I am afraid the columns are static and they will have to change if you have additional records.

 

Please have a look at this workflow. I have adjusted it to construct and pickup the names dynamically.

 

It will give you an idea that you can expand on.

 

Let us know if any issues at all. We will always figure something out.

Labels