community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Combine two colums in a formula

Highlighted
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

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

Alteryx Certified Partner

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

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

Meteoroid

Hi @Barrypol1976 ,

 

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

 

Regards

Labels