Alteryx Designer Desktop Discussions

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

Formula- Unknown variabale 'Endif'

stevenlsj789
8 - Asteroid

Hi- I am encountering this error message in formula tool attached below and could someone please help and let me know how I can fix it? Thank you! 

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @stevenlsj789 

 

You need to put "ELSE [ID] ENDIF".

 

In the Else clause, it's necessary to mention the field.

 

Cheers,

stevenlsj789
8 - Asteroid

@Thableaus 

Thank you!. That helped. But now I have added [ID]. 

It shows error of 'Type mismatch. where string is required.'

Any idea why? 

I attached the workflow below. Thanks again!

Thableaus
17 - Castor
17 - Castor

@stevenlsj789 

 

You're misusing the TRIMRIGHT function.

 

TrimRight(x, y): Removes character in the string y from the end of the string x. Y is optional and defaults to trimming white space

 

The "Y" argument needs to be a string, you put a 2 over there.


Cheers,

Thableaus
17 - Castor
17 - Castor

@stevenlsj789 

 

I'm not so sure what you're trying to do, but you could use this:

 

Replace([ID], "ID", "")

 

Cheers,

Labels