ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community will be temporarily unavailable for a time due to scheduled maintenance on Thursday, April 22nd. Please plan accordingly.

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
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

...

KaneG
Alteryx
Alteryx

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
19 - Altair
19 - Altair

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

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
john_miller9
11 - Bolide

Perfect - thanks!


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

ZHENGCH
8 - Asteroid

Hi Kane

 

The switch is really helpful!

 

Thanks

Marko1986
6 - Meteoroid

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
Alteryx

Hi @Marko1986

 

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

 

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

Labels