ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Malformed IF Statement error on a simple If formula

Goran
アステロイド

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件の返信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
ボリード

The syntax should be:

 

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

Goran
アステロイド

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

ラベル
トップのソリューション投稿者