Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Renaming column headers

Sumit_Das
6 - Meteoroid

Hello All, would be much appreciated if you could help on the below section:

 

I have a raw data, whose column name looks like this:

T-3T-2T-1TT+1T+2T+3T+4T+5T+6T+7T+8
111111111111

 

And I want to update the column name to below output

2000-Q12000-Q22000-Q32000-Q42001-Q12001-Q22001-Q32001-Q42002-Q12002-Q22002-Q32002-Q4
111111111111

 

Please note that, my dataset consist of more than 100 columns in continuation of that one. (so manual intervention using tool Select tool will not be helpful for me)

 

Thanks in advance!

5 REPLIES 5
Sumit_Das
6 - Meteoroid

Thanks marlontalisvista,

 

But I have just shared a sample data aforesaid, My dataset consist of more than 100 columns in continuation of that one..So, I believe manually wouldn't be much helpful.If you have any other solution (like using Transpose, Multi-Row and Dynamic Rename or any other tools)  please advise.

PhilipMannering
16 - Nebula
16 - Nebula

Hi @Sumit_Das 

 

This isn't trivial, but see if the attached solves for your need. You need to set T, then everything else is relative to that one Quarter. Let me know if any issues/questions.

 

Thanks,

Philip

 

danilang
19 - Altair
19 - Altair

Hi @Sumit_Das 

 

Here's a different take.  

 

danilang_0-1633355285748.png

 

It uses the Field info tool to extract the column names.  The T Year and Quarter Text Input is where you specify the year and quarter that match your T.  After finding the T column name in the Join tool and appending match info, all the work takes place in the Formula tool.   

 

danilang_1-1633355485976.png

First the offset from the T year is extracted from the column name.  Then the Q is calculated for each row and then the corresponding year.  Finally these are combined into the NewName column.  This is used in the Dynamic Rename to rename the columns.

 

Since the workflow acts on the metadata and doesn't have to sort the data, its run time is independent on the number of rows in the data set.

 

Dan 

 

 

 

 

 

Sumit_Das
6 - Meteoroid

Thanks Philip and Dan, that's really helpful for me. Cheers

sgwong
8 - Asteroid

Seek your advice on dymanic rename header on date format only.

 

Input Data:

Input.jpg

 

Output Data:

Output.jpg

Labels
Top Solution Authors