Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic Rename with condition

DataKiller
7 - Meteor
Hello, I need help to achieve this: some column names missed "0" at second letter, like PD56, I need to rename it to P0D56. example:
6 REPLIES 6
ramesh_neel
11 - Bolide
11 - Bolide

@DataKiller  - Hope this helps !

Alteryx ACE | Sydney Alteryx User Group Lead | SparkED Contributor and Mentor
DataKiller
7 - Meteor

Thanks! 

And can we add IF condition? because just some of column names are missed "0"

If length = 5, the column is correct. if not, need to add "0"

 

ramesh_neel
11 - Bolide
11 - Bolide

Yes , I have updated the workflow to include that condition.

Alteryx ACE | Sydney Alteryx User Group Lead | SparkED Contributor and Mentor
DataKiller
7 - Meteor

Thanks so much!!!

DataKiller
7 - Meteor
Hi, still have some problem when apply it to my *.csv format. I upload the file for asking your help.
ramesh_neel
11 - Bolide
11 - Bolide

From this , it looks like you would like to row values to be reamed not COLUMN as per your initial post . This can be achieved using a formula tool , 

1) Drag the formula tool next to the input

 

2)select [I0D] under Output Column and add the below 

 

if length([I0D] )!=5 then
Substring([I0D],0,1)+"0"+Substring([I0D],1,Length([I0D]))
else
[I0D]
endif

Alteryx ACE | Sydney Alteryx User Group Lead | SparkED Contributor and Mentor
Labels