Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

merged header to column

Haokun
8 - Asteroid

Hi I have a data set likes below, the first row has some period header which I want to make those period into one of the column.

    1month  3months  
Fund NameFUMInception DateFMCFundBMRELFundBMREL
CITI1001/11/199011.560.52.2590.75
SCB2001/11/19902241361.5
JP3001/11/19901-1-4-0.5-1.5-6-0.75
ALLIANCE4001/11/19902-2-5-1-3-7.5-1.5

 

May I know how to transform to the below table?

Fund NameFUMInception DateFMCPeriodFundBMREL
CITI1001/11/199011month1.560.5
SCB2001/11/199021month241
JP3001/11/199011month-1-4-0.5
ALLIANCE4001/11/199021month-2-5-1
CITI1001/11/199013months2.2590.75
SCB2001/11/199023months361.5
JP3001/11/199013months-1.5-6-0.75
ALLIANCE4001/11/199023months-3-7.5-1.5

 

Thanks guys.

7 REPLIES 7
Qiu
21 - Polaris
21 - Polaris

@Haokun 
Hope this is what you need.

1123-Haokun.PNG

anjaliaithal
7 - Meteor

Please check the attached solution.

 

Haokun
8 - Asteroid

hi @Qiu 

Thanks! but there will be alot of periods behind, such as 9months, 1 year, year to date, since inception and so on.

Is there an easier way without using Regex?

atcodedog05
22 - Nova
22 - Nova

Hi @Haokun 

 

Is it possible to share an excel file of the sample data. So that the solution can be tailored according to data structure.

AngelosPachis
16 - Nebula

Hi @Haokun ,

 

If you group in the first 4 fields (Fund Name, FUM, Inception Date and FMC) before transposing and assign some record ID to maintain the sorting order of the original file, then with a join you can make a workflow quite robust and it will work for more periods than just those provided.

 

Screenshot 2020-11-23 095625.jpg

 

Hope that helps, let me know if there are any questions on the workflow.

 

Regards,

 

Angelos

Haokun
8 - Asteroid

hi @AngelosPachis 

are you able to save your workflow to yxmd format? i am not sure why i can't open your workflow but seems your workflow is what i want. 

AngelosPachis
16 - Nebula

Oh I see, probably that's my bad, this .yxzp file is a packaged workflow and it is not supported in all Alteryx versions.

 

I've attached the workflow in a .yxmd and the input file it uses; I've created an .xlsx file which would look similar to your input,

 

Let me know if it worked for you this time.

Labels
Top Solution Authors