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

Replace values in multiple fields

john_miller9
11 - Bolide

Hi all,

 

I'm looking at survey data that has standard Likert type repsonses (Agree, Strongly Agree, etc.) and i'd like to update these responses to numerical values rather than the text (e.g. Strongly Disagree = 1, Disagree = 2, etc.).  I thought that the Multi-Field Formula tool would be the way to go but can't figure out if I have it configured correctly.  Any thoughts?

 

Thanks

jm

 

 

Replace([_CurrentField_], 'Strongly Disagree', '1')
AND
Replace([_CurrentField_], 'Disagree', '2')

AND

...

6 REPLIES 6
KaneG
Alteryx Alumni (Retired)

Hi John,

 

There are 2 ways off the top of my head. Either Nested replaces, or a switch formula. So using your example either:

 

Replace(Replace([_CurrentField_], 'Strongly Disagree', '1'), 'Disagree', '2')

 

OR

 

Switch([_CurrentField_],[_CurrentField_],

'Strongly Disagree', '1',

'Disagree', '2')

 

Kane

MarqueeCrew
20 - Arcturus
20 - Arcturus

Here is a pic and a demo module of @KaneGsCapture.PNG suggestion

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
john_miller9
11 - Bolide

Perfect - thanks!


I was a little unsure about the 'Default' part of the Switch function.

cbz
8 - Asteroid

Hi Kane

 

The switch is really helpful!

 

Thanks

Marko1986
7 - Meteor

Hello guys

 

I really need help with next situation. I have two problems

 

1. I need to replace "," with "." in multiple fields so I can have double values instead of VString. 

2. I'm trying to use multiple-field formula but I really don't understand how to properly write formula in multiple field forumula tool.

 

F9, F13, F15, F16 are all VString fields that I need to be double fields without losing number after comma.

 

Sending you SS in attachmentMulti-field formula problem.PNG

KaneG
Alteryx Alumni (Retired)

Hi @Marko1986

 

The formula should be the same as above just with the field being [_CurrentField_]

 

Replace([_CurrentField_],',','.')

Labels