Alteryx Designer Desktop Discussions

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

changing a value to be a combination of 2 values

EMPMUK
6 - Meteoroid

Hi All, 

 

Sorry I'm so new to Alteryx so all my questions are super basic!

 

Is there a way for me to apply a formula here to say if the size is big to rename the animal "big" animal

 

I've tried the below using an ampersand as though in excel and am getting a parse error - is it possible without appending a new column

 

output column: animal

 

if size= "big" then size & animal else animal

 

sizeanimalname
bigdogboris
smallcatmark
mediummonkeygina
smallcowtracy
mediumcathelga
smallmonkeybenny
bigcowtim
   

 

Help massively appreciated!

 

Thanks, 

EM

8 REPLIES 8
DataNath
17 - Castor

Hey @EMPMUK - very close, you just need to amend the Syntax a little and use a + instead! If you use the following expression in a Formula tool you ought to get the expected output:

 

if [size]='big' then 'big '+[animal] else [animal] endif

 

TimN
13 - Pulsar

Further example...

EMPMUK
6 - Meteoroid
if [size] = "big"
then
'big'+[animal]
else
[animal]

thanks so much for your quick answer - this is what I have in now but still getting parse error. Am I missing something 🤔

TimN
13 - Pulsar

You need Endif at the end

EMPMUK
6 - Meteoroid

oooh I realise this is in an appended column, is this what I'll need to do? no way to rename in the same colunm?

TimN
13 - Pulsar

IF [size] = 'big' THEN [size] + " " + [animal] ELSE [name] ENDIF

EMPMUK
6 - Meteoroid

Oh FGS! I'm still getting used to the change in formulae, thank you!

TimN
13 - Pulsar

Just like and mark the solution if any of the replies helped.

 

Thanks.

Labels