Alteryx Designer Desktop Discussions

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

Malformed IF Statement error on a simple If formula

Goran
8 - Asteroid

Hi everyone,

 

Really not sure what I'm doing wrong here.  I have the following IF statement: 

 

IF [RecordID] = 1 THEN ([Core Time]+[Work Out]) END

 

I keep getting that Malformed error message regardless how I wrap the 1 whether it ends with END or ENDIF.  

 

RecordID is a calculated field, so perhaps that's the issue?

 

Any help would be appreciated!

3 REPLIES 3
afv2688
16 - Nebula
16 - Nebula

Hello @Goran 

 

You are missing the else statement

 

IF [RecordID] = 1 THEN ([Core Time]+[Work Out]) ELSE <SOMETHING HERE> ENDIF

 

for example:

 

IF [RecordID] = 1 THEN ([Core Time]+[Work Out]) ELSE [Core Time] ENDIF

 

Regards

mpennington
11 - Bolide

The syntax should be:

 

IF [RecordID] = 1 THEN ([Core Time]+[Work Out])  ELSE '' ENDIF

Goran
8 - Asteroid

Thank you.  I didn't realize IF statements always needed to have an ELSE

Labels