I have a Likert Scale with answers '-2, '-1, 0, 1, 2
Excel cannot calculate the AVERAGE and SD with these numbers, therefore I want to change them
'-2 -> 1
'-1 -> 2
0 -> 3
1 -> 4
2 -> 5
I put a SWITCH Formula in Alteryx, but it doesn't work... Do you know where my mistake is?
My syntax is Switch([_CurrentField_],0,''-2',1,''-1',2,'0',3,'1',4,'2',5)
Solved! Go to Solution.
It looks like you are missing quotes around each of the values - in addition because some of your values have apostrophes I would suggest using double quotes
Switch([_CurrentField_],"0",'''-2","1","'-1","2","0","3","1","4","2","5")
IF you want to force it then to be a Double you could surround the entire thing with ToNumber()
@Suedseeperle
I tested the Switch Function and it works just ok in below.
Another way I would recommend is that Find and Replace tool.
We can have an indexing chart for converting and it is easy to update in case you want to change something.
Great thanks guys that really helped, both solutions work :)