Alteryx Designer Desktop Discussions

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

Using IF statement with multiple Boolean columns

CBarger
5 - Atom

Hello. New to Altryx. Tried Googling and can't seem to find a good answer. I am trying to create a filter based on if the Bool value in two different columns is True. I have tried multiple formulas, but I still don't ever return any results (and yes, looking at the raw file, there are True-True combinations). Ultimately I want to only keep the rows where I have True in both of the columns. I already changed the dtype from V_String to Bool. Below I am creating a new column called Scenario1 as my output and am attempting to assign "keep" or "delete" based on if both bools = True (so, "keep" if bool-bool = true-true and "delete" for all other bool-bool combinations)

 

IF ([Anchor] = 1 && [Band] = 1)  THEN "Keep" ELSE "delete" ENDIF

3 REPLIES 3
Thableaus
17 - Castor
17 - Castor

Hi @CBarger 

 

Could you please share your workflow with a sample of your data, showing the unexpected results?

 

Cheers,

jrgo
14 - Magnetar

@CBarger ,

 

If those two fields are set to BOOL field types, this expression in a formula tool should work. If you prefer to use &&, you can.

[Anchor] AND [Band]

 

image.png

Jimmy
Teknion Data Solutions

CBarger
5 - Atom

Thanks so much! Not sure why I wasn't getting any "true" for the true-true combination before, but your suggestion worked perfectly!

Labels