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

Transposing data with multiple columns

shravanvijayaprasad
8 - Asteroid

I know this question has been asked and answered  a few times but I am struggling with it anyway. 

 

I am trying to take the below set up:

 

FundFund NamePeriod 1Period 2Period 1 ExchangePeriod 2 Exchange
Fund 1Fund Name 11001500.250.24
Fund 2Fund Name 22002500.870.86

 

and change it to this:

 

FundFund NamePeriodExchangePeriod ValueExchange value
Fund 1Fund Name 1Period 1Period 1 Exchange1000.25
Fund 1Fund Name 1Period 2Period 2 Exchange1500.24
Fund 2Fund Name 2Period 1Period 1 Exchange2000.87
Fund 2Fund Name 2Period 2Period 2 Exchange2500.86

 

Any help would be appreciated.

 

P.S - I tried transposing twice but it creates Period 1 with Period 1 Exchange and Period 2 Exchange for fund 1

 

Thanks in advance!!

4 REPLIES 4
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @shravanvijayaprasad,

 

This should achieve what you're looking to do. I also used two transpose tools but then filtered after to remove rows not required.

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

shravanvijayaprasad
8 - Asteroid

This solves the issue for this mock data and would work but I'm wondering if there is a different way to do this (waiting and hoping there is different answers. Also, interesting use of Regex, I haven't used Regex so much, could you explain what exactly is happening in the formula part?

shravanvijayaprasad
8 - Asteroid

@ Thank you so much for the answer. Just as a curious follow up, what if the columns aren't named as Period 1 and Period 1 exchange and is instead renamed as Period 1 and Exchange One or something like that?

Jonathan-Sherman
15 - Aurora
15 - Aurora

@shravanvijayaprasad the regex_replace function is extracting the number from the cell and overwriting the cell with just that number. For your follow up question, if they aren't named Period 1 and Period 1 exchange but period 1 and period one exchange i'd change the formula to something along the lines of:

 

CONTAINS([column 1], 1) AND CONTAINS([Column 2], "one")

OR CONTAINS([column 1], 2) AND CONTAINS([Column 2], "two")

 

If this solves your question please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

Labels