Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

IF CONTAINS EQUALS

jalizmaldonado
8 - Asteroid

Hi, I hope all is well. 

 

I'm trying to understand a few things while also fixing a formula:

 

1. What's the difference between '=' and '==' 

- I'm assuming I used it correctly below

2. How do you end an 'IF Contains" formula

If Contains([Input Rate], "GST")
THEN [Recoverable Tax (Base Currency)]==[Input GST]


3. How do you end an 'IF Contains' statement if you add an "OR" or an "AND"

If Contains([Input Rate], "EXCLUDE")
THEN [Recoverable Tax (Base Currency)]==[Exclude]
OR
If Contains([Output Rate], "EXCLUDE")
THEN [Tax Amount (Base Currency)]==[Exclude]
ELSE ''
ENDIF

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @jalizmaldonado 

 

To answer your questions in order:

  1. There is no difference as far as I know
  2. You need to have an else clause and an 'endif' for example:
    1. If Contains([Input Rate], "GST")
      THEN [Recoverable Tax (Base Currency)]==[Input GST] Else Something Endif
  3. Change the OR to an Elseif
    1. If Contains([Input Rate], "EXCLUDE")
      THEN [Recoverable Tax (Base Currency)]==[Exclude]
      ElseIf Contains([Output Rate], "EXCLUDE")
      THEN [Tax Amount (Base Currency)]==[Exclude]
      ELSE ''
      ENDIF

       

       

jalizmaldonado
8 - Asteroid

It appears that I was being repetitive in my formula:

 

If Contains([Input Rate], "GST")
THEN [Recoverable Tax (Base Currency)] else "" endif

Labels
Top Solution Authors