Alteryx Designer Desktop Discussions

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

Formula Calculation Method (IF)

SH_94
11 - Bolide

Dear Community,

 

Currently i plan to write the formula for the following table:

SH_94_0-1623504035733.png

The formula i plan to write as below:

If Method=Multiply, then Amount 1 *Rate

Else Amount 1/Rate

 

May i know if there is any better idea or could anyone please enlighten me if the formula that i put is correct?

 

Many thanks in advance.

 

 

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @SH_94 your arguments in your formula are correct the syntax does need altering. You need to wrap Multiply in quotes because it's text, the coma after multiply is not needed. Your columns need Square brackets and lastly you need Endif at the end. 

 

If [Method]="Multiply" then [Amount 1] *[Rate]

Else [Amount 1]/[Rate]

Endif

 

DawnDuong
13 - Pulsar
13 - Pulsar

HI @SH_94 

When i was new to Alteryx, one trick I used to avoid syntax error when using IF statement is to type the "blank" formula first, like below:

IF

THEN

ELSE

ENDIF

 

Then I'll fill in the evaluation / outcome expression. This is to avoid the oft-encountered syntax error of inserting comma "," which Excel users (like myself) often make at the beginning.

Highly recommend that you watch the interactive lessons "For Excel Users" too.

Cheers,

Dawn.

SH_94
11 - Bolide

Hi @JosephSerpis ,

 

Thanks a lot for the guidance and sharing on how to write the IF formula.

 

 

Appreciate it a lot.

Labels