Alteryx Designer Desktop Discussions

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

Combine two colums in a formula

Barrypol1976
Meteoroide

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 RESPUESTAS 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
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
Meteoroide

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
Cometa

Hi @Barrypol1976 ,

 

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

 

Regards

Etiquetas