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 Early 2026. 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

Update Column based on Multiple Filters

RonitGupta
7 - Meteor

I want to update Column [Product Family] and there are three filters while binaryAnd accepts two only.

 


IF BinaryAnd([Plant]="A",[Product Family]="B",[Product Category]="C") THEN "X" ELSE [Product Family] ENDIF

 

How to deal with that?

 

I have sometime more than 4 filters too. 

16 REPLIES 16
Felipe_Ribeir0
16 - Nebula

Hi @RonitGupta 

 

You can use the formula like this, please see if it works for you

IF [Plant]="A" AND [Product Family]="B" AND [Product Category]="C" THEN "X" ELSE [Product Family] ENDIF

 

Felipe_Ribeir0_0-1672058972685.png

 

ShankerV
17 - Castor

Hi @RonitGupta 

 

You need to use the IF statement without BinaryAnd.

 

IF [Plant]="A" AND

[Product Family]="B" AND

[Product Category]="C")

THEN "X"

ELSE [Product Family]

ENDIF

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

RonitGupta
7 - Meteor

Hello Felipe,

 

Thanks. It worked for me. 

 

I have cases where there are 10 product categories and I need to update only 3 based on already selected two filters. I hope OR should work along with AND.

 

IF [Plant]="A" AND [Product Family]="B"  AND OR([Product Category]="C", [Product Category]="D",[Product Category]="E") THEN "X" ELSE [Product Family] END IF

 

 

ShankerV
17 - Castor

Hi @RonitGupta 

 

AND OR cannot be used at the same time, It will be an error.

ShankerV
17 - Castor

 @RonitGupta 

 

Please use the below.

 

IF [Plant]="A" AND [Product Family]="B" AND [Product Category]="C"
THEN "X"
elseif [Plant]="A" AND [Product Family]="B" AND [Product Category]="D"
THEN "X"
elseif [Plant]="A" AND [Product Family]="B" AND [Product Category]="E"
THEN "X"
ELSE [Product Family]
ENDIF

 

ShankerV_0-1672060924858.png

 

Felipe_Ribeir0
16 - Nebula

Hi @RonitGupta 

 

Please see if this is what you are looking for:

 

IF [Plant]="A" AND [Product Family]="B" AND ([Product Category]="C" OR [Product Category]="D" OR [Product Category]="E") THEN "X" ELSE [Product Family] ENDIF

RonitGupta
7 - Meteor

Hi,

 

This is not working. For product category D and E, irrespective of other criteria it give X. 

 

ShankerV
17 - Castor

Hi @RonitGupta 

 

I strongly believe the below formula will give you the expected output.

Please check and confirm.

 

IF [Plant]="A" AND [Product Family]="B" AND [Product Category]="C"
THEN "X"
elseif [Plant]="A" AND [Product Family]="B" AND [Product Category]="D"
THEN "X"
elseif [Plant]="A" AND [Product Family]="B" AND [Product Category]="E"
THEN "X"
ELSE [Product Family]
ENDIF

 

I have checked with example also and shared the output.

 

ShankerV_0-1672132808689.png

 

 

Many thanks

Shanker V

RonitGupta
7 - Meteor

Hi ShankerV,

 

The solution provided by you is working well. Thanks a lot!

 

I am unable to mention someone while replying using "@".  I don't know how to mention someone on this forum. 

 

Labels
Top Solution Authors