In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Multiple "IF" conditions

kmontoya
7 - Meteor

Hello, 

 

I have a set of data that needs to have filters and categorize it from excluded or included based on multiple things. Is there a way I can create a key or legend in alteryx to have this flow? 

 

For example, If

  • "instrument type" = cashflow - "excluded"
  • "exchange" = AVG or GTO = "Excluded"
  • anything else needs to say included 

 

thank you in advance! 

 

2 REPLIES 2
patrick_digan
17 - Castor
17 - Castor

@kmontoya Try something along these lines:

 IF [instrument type] = "cashflow" or [exchange] in ("AVG","GTO") then "Excluded" else "Included" endif
KGT
12 - Quasar

The formula above is easiest.

 

If you have a list of 75 items, that may not work. I would do this by creating a look-up table and then use a find replace to append the include/exclude.

 

The lookup table would be like this:

FieldTermDecision
instrument typecashflowExclude

 

Then either use that trickily on the whole set at once, or use a filter for each [Field] term and apply once at a time.

  • Once at a time would need to consider how to evaluate whether each row is include/exclude. I would use record ID, Summarise(Concatenate) and a formula for IIF(Contains([concat_decision],"excluded"),"Excluded","Included")