Why won't this work?
IF [F1]="Network: GLITZ TV ARGEN" OR IF [F1]="Network: GLITZ TV Panregional" OR IF [F1]="Network: SPACE ARGEN" OR IF [F1]="Network: SPACE MEXICO" OR IF [F1]="Network: TNT Argentina" OR IF [F1]="Network: TNT Chile" OR IF [F1]="Network: TNT Mexico" OR IF [F1]="Network: TNT Series" OR IF [F1]="Network: Boomerang Latin America" OR IF [F1]="Network: Cartoon Network Argentina" OR IF [F1]="Network: Cartoon Network Mexico" OR IF [F1]="Network: TBS VERY FUNNY ARGENTINA" OR IF [F1]="Network: TBS VERY FUNNY BRAZIL" OR IF [F1]="Network: TBS VERY FUNNY PANREGIONAL H" OR IF [F1]="Network: TURNER CLASSIC MOVIES" OR IF [F1]="Network: TURNER CLASSIC MOVIES ARGEN" OR IF [F1]="Network: Warner Channel Andes" OR IF [F1]="Network: Warner Channel Mexico"
THEN "YES"
ELSE ""
ENDIF
Solved! Go to Solution.
That's not quite the right syntax. Here is a revised IF statement:
IF [F1] in ("Network: GLITZ TV ARGEN", "Network: GLITZ TV Panregional", "Network: SPACE ARGEN", "Network: SPACE MEXICO", "Network: TNT Argentina", "Network: TNT Chile", "Network: TNT Mexico", "Network: TNT Series", "Network: Boomerang Latin America", "Network: Cartoon Network Argentina", "Network: Cartoon Network Mexico", "Network: TBS VERY FUNNY ARGENTINA", "Network: TBS VERY FUNNY BRAZIL", "Network: TBS VERY FUNNY PANREGIONAL H", "Network: TURNER CLASSIC MOVIES", "Network: TURNER CLASSIC MOVIES ARGEN", "Network: Warner Channel Andes" , "Network: Warner Channel Mexico") THEN "YES" ELSE "" ENDIF
There are many ways to skin this cat!
Cheers,
Mark
P.S. Please consider a vote for our Analytic Excellence Entry: https://community.alteryx.com/t5/Alteryx-Analytics-Excellence/Excellence-Awards-2017-Adam-Rant-From-...
How about:
IF [F1] IN(
"Network: GLITZ TV ARGEN",
"Network: GLITZ TV Panregional",
"Network: SPACE ARGEN",
"Network: SPACE MEXICO",
"Network: TNT Argentina",
"Network: TNT Chile",
"Network: TNT Mexico",
"Network: TNT Series",
"Network: Boomerang Latin America",
"Network: Cartoon Network Argentina",
"Network: Cartoon Network Mexico",
"Network: TBS VERY FUNNY ARGENTINA",
"Network: TBS VERY FUNNY BRAZIL",
"Network: TBS VERY FUNNY PANREGIONAL H",
"Network: TURNER CLASSIC MOVIES",
"Network: TURNER CLASSIC MOVIES ARGEN",
"Network: Warner Channel Andes",
"Network: Warner Channel Mexico"
)
THEN "YES"
ELSE ""
ENDIF
Both seemed to be along the same line. Second one was just a little easier to read as it was listed. Either way thanks to both of you for your help.
Hey @jobytrice
In cases like this where you are using a large number of static strings - another way to do this (which is a neater and easier to debug) is:
- Create a text input where you list these strings. You could call the input something like "InScope"
- Then use a basic join to your main data set, joining on this field
Given that the join has 3 outputs:
L: will be all the rows that don't have one of these values
J: will be all the rows that do have one of these values
R: will be a list of all the values that didn't appear on a row
The thing I like about doing it this way is that you can easily bring a spreadsheet into a text-input in seconds, and a join takes seconds - so you can be up and running incredibly quick and if you need to change anything you don't need to mess around with a complicated formula.
That doesn't take away from the work of @Joe_Mako and @MarqueeCrew - if you want to use the formula, their solution is the right way to do it.
Cheers @jobytrice
Sean
@SeanAdams wrote:Hey @jobytrice
In cases like this where you are using a large number of static strings - another way to do this (which is a neater and easier to debug) is:
- Create a text input where you list these strings. You could call the input something like "InScope"
- Then use a basic join to your main data set, joining on this field
Given that the join has 3 outputs:
L: will be all the rows that don't have one of these values
J: will be all the rows that do have one of these values
R: will be a list of all the values that didn't appear on a row
The thing I like about doing it this way is that you can easily bring a spreadsheet into a text-input in seconds, and a join takes seconds - so you can be up and running incredibly quick and if you need to change anything you don't need to mess around with a complicated formula.
That doesn't take away from the work of @Joe_Mako and @MarqueeCrew - if you want to use the formula, their solution is the right way to do it.
Cheers @jobytrice
Sean
Using the Join tool as a filter for multiple values is one of my favorite things I've discovered as a new user!