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 tool multiple conditions Uppercase/Replace & rename based on field position

Shaiy10
7 - Meteor

Hi

 

I need to apply multiple conditions to the rename tool

something like below

 

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

 

the first condition works fine i.e. change case to uppercase and replace spaces with an underscore

however

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

as the 6th field name always keeps changing every month with the respective MONTH

 

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

Interesting challenge, it's possible but I would use a different technique to do it, which would be to create a lookup table using the field info and formula tools and then using the 'take headers from right input rows' option...

 

Example attached...

 

2019-03-11_15-50-19.png

Shaiy10
7 - Meteor

Hi @

 

your workflow does attend to the problem

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

 

 

your solution does work but had to make a small tweak in your formula to get the result

IF [RecordID] = 6 THEN

REPLACE([NewName],"*","TARGET") else [NewName] endif

 

had to change it to the below

IF [RecordID] = 6 THEN

"TARGET" else [NewName] endif

 

thanks for the solution

jsuptic
7 - Meteor

Thank you! I did not realize If/Then logic was allowed in the Dynamic Rename formula. I am going to have to start tinkering way more with all the different tools.

Labels