In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
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