Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Combine two colums in a formula

Barrypol1976
6 - Meteoroid

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 REPLIES 4
RishiK
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
15 - Aurora

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
6 - Meteoroid

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
9 - Comet

Hi @Barrypol1976 ,

 

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

 

Regards

Labels