Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic rename of only certain field types in a dataset

apatel1501
8 - Asteroid

I'm looking to dynamically rename (adding a prefix)  to only the numeric (double) fields from a dataset. The number of years will vary from dataset to dataset. I need to keep the string fields so I'm not sure a dynamic select will work.

 

Fields look like:

 

Customer | Product | P01 | P02 | P03..........etc. the number of years can be as much as the data i have

 

After the dynamic rename, i'd like it to look like:

 

Customer | Product | Sales_P01 | Sales_P02 | Sales_P03

 

I've considered just making a table and mapping in from the right input of a dynamic rename, but as mentioned - the number of years will vary. theoretically, i could just make the right input table up to 100 years and that would absolutely suffice. But i'm hoping theres a cleaner way to do it using a formula in the dynamic rename. Potentially some regex as the years will always be in the "P" + \d format.

 

Thanks!

2 REPLIES 2
DavidSkaife
13 - Pulsar

Hi @apatel1501 

 

Will it only be the numeric fields that will vary from dataset to dataset, and Customer/Product will ALWAYS be static?

 

If that is the case you can use the Dynamic Rename and tick the 'Dynamic or Unknown Fields option and it will handle this for you

 

Capture.PNG

apatel1501
8 - Asteroid

Correct - it will only be the numeric fields.  Much more simple solution - Thank you! (Never quite realized what dynamic/unknown fields box was for. Makes a lot of sense now.

Labels
Top Solution Authors