Alteryx Designer Desktop Discussions

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

Capitalise the header/field names to UPPERCASE and replace the spaces

Shaiy10
7 - Meteor

Hi All,

 

I am taking an input from an excel file where the header/field names are as below

Function / Function ID / Region / Region ID

 

there are too many tables and too many columns to rename manually

i need a solution to convert all the header/field names to UPPERCASE and replace the spaces with an underscore as the header names in my oracle table appear that way

for eg. the above header names should convert to the below

 

FUNCTION / FUNCTION_ID / REGION / REGION_ID

 

is this possible in alteryx?

 

thanks,

9 REPLIES 9
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Shaiy10,

 

You can use a DYNAMIC RENAME tool to do the job.  Select ALL fields (that you want to operate on) and use Formula with:

 

Replace(UpperCase([_CurrentField_])," ", '_')

Your fieldnames will now be the FIELDNAMES that you want.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
danilang
19 - Altair
19 - Altair

Hi @Shaiy10 

 

Use Dynamic Rename tool with the following configuration

 

Dynamic Rename.png

 

Replace(UpperCase([_CurrentField_])," ","_")

Dan

 

 

Shaiy10
7 - Meteor

thanks for the quick solution, as was unable to figure out the syntax...

MarqueeCrew
20 - Arcturus
20 - Arcturus
By asking the question you are helping members find what might be a common challenge.

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Shaiy10
7 - Meteor

Hi @

 

additionally i need to add a condition to same syntax earlier to replace the 6th field name with specific word "TARGET"

as the 6th field name always keeps changing with the month name 

something like below

 

Replace(UpperCase([_CurrentField_])," ","_")
or
replace(([_Field_No_6_]),"*","TARGET")

Shaiy10
7 - Meteor

Hi @danilang

 

additionally i need to add a condition to same syntax earlier to replace the 6th field name with specific word "TARGET"

as the 6th field name always keeps changing with the month name 

something like below

 

Replace(UpperCase([_CurrentField_])," ","_")
or
replace(([_Field_No_6_]),"*","TARGET")

danilang
19 - Altair
19 - Altair

hi @Shaiy10 

 

Use a Dynamic select to treat the 6th column separately

 

solution.png

Shaiy10
7 - Meteor

thanks - working nicely

 

also one more solution discussed at the below link

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Dynamic-Rename-tool-multiple-condition...

 

 

i was trying to do this in the dynamic rename itself with a single formula as below without using the right input

 

IF ([_FieldNumber_] = 6) THEN Replace(UpperCase([_CurrentField_]),"*","TARGET")
ELSE
Replace(UpperCase([_CurrentField_])," ","_")
ENDIF

 

the above formula does not recognise the Fieldnumber variable

 

rohit782192
11 - Bolide

This is a wonderful Solution even i have also tried. It work for me.

Labels