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.
解決済み

Combine two colums in a formula

Barrypol1976
メテオロイド

Dear All,

 

just starting with Alteryx and having some difficulties with a formula. I'm trying to combine two columns but i'm getting a error message  malformed if statement.

 

When the results of vitamin c in not present then zero but when there is then combine two columns, vitamin C and the UOM (like 0,3 mg)

 

IF [VITAMINE_C] = 0 THEN 0 ELSEIF [VITAMINE_C]+[UOM_VITAMINE_C]
ENDIF

 

Thanks for the help

4件の返信4
rkapoor
Alteryx
Alteryx

Hi there

 

You have written your IF ELSE expression slightly wrong.  It should be:

 

IF [VITAMINE_C] = 0 THEN 0 ELSE [VITAMINE_C]+[UOM_VITAMINE_C]
ENDIF

LordNeilLord
オーロラ

Hey @Barrypol1976 

 

You always need to have an "else" in your IF statement

 

So something like IF  [VITAMINE_C] > 0 Then [VITAMINE_C]+[UOM_VITAMINE_C] Else 0 Endif

Barrypol1976
メテオロイド

Neil,

 

thanks for your quick reply. I'm still having some troubles. Hopefully you can check it one more time, thanks for your time.

 

 

Data preview.PNG

JulioMO
コメット

Hi @Barrypol1976 ,

 

The operator "greater or equal" should be written as >= instead of =>. 

 

Regards

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