Multiple AND and CONTAINS in IF THEN Statement
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Stummschalten
- Drucker-Anzeigeseite
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Moderator informieren
Hi All,
In the Formula Tool I'm trying to use the following IF THEN statement to update BRAND but it's not working properly. X and Z are changed to "ALL STILL XLIC":
if !CONTAINS([BRAND],"X") && contains([CARBONATION],"NON") && contains([TYPE],"XLIC")
then "ALL STILL XLIC"
ELSEif !CONTAINS([BRAND],"Z") && contains([CARBONATION],"NON") && contains([TYPE],"XLIC")then "ALL STILL XLIC"
else [BRAND] endif
Is it not possible to have three conditions in the statement?
Gelöst! Gehe zu Lösung.
- Beschriftungen:
- Expression
- Help
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Moderator informieren
I would put parentheses around certain things I want to segregate....
IF (!contains(......)) && etc....
Does that help? If so, then we've learned something about Alteryx's order of operations.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Moderator informieren
Hi @danielasmith,
Think about it this way, your X is passing through your first if statement, but it is being caught in your elseif statement, and is therefore label 'ALL STILL XLIC'. Similarly, your Z is being caught in the first if statement. I think what you really want is to have all four conditions in one line:
if !CONTAINS([BRAND],"X") && !CONTAINS([BRAND],"Z") && contains([CARBONATION],"NON") && contains([TYPE],"XLIC")
then "ALL STILL XLIC"
else [BRAND] endif
Best,
mmenth
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Moderator informieren
Thanks! I am trying this now! Will let you know if it works.