SOLVED
IF AND Statement
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
kschulke
5 - Atom
‎08-07-2019
08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm trying to write and IF and Statement: IIf (Balance 12.31.2018=0 AND Balance 6.30.2018<>0, "New", "No") but it gives me an error. I'm trying to say that as long as my 12/31 balance is 0 and my 6/30 balance is anything other than 0 to return "New". Any help would be greatly appreciated!
Solved! Go to Solution.
Labels:
- Labels:
- Expression
5 REPLIES 5
LordNeilLord
15 - Aurora
‎08-07-2019
08:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @kschulke
What error do you get?
Your statement looks good but without more information its hard to diagnose
Thableaus
17 - Castor
‎08-07-2019
08:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @kschulke
I think you're probably getting the operator wrong.
IIf (Balance 12.31.2018=0 AND Balance 6.30.2018!=0, "New", "No")
Use != instead of <>
Also, check for datatypes.
Cheers,
‎08-07-2019
08:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It says "An expression cannot end with an operator" I'm guessing it doesn't like the <> but not sure how to fix it?
‎08-07-2019
08:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks so much! Works perfect!
Claje
14 - Magnetar
‎08-07-2019
08:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I found two issues here:
You need brackets around your field names (since there is a space in them), and Alteryx does not use <> as "Not equals", instead it uses !=
IIf ([Balance 12.31.2018]=0 AND [Balance 6.30.2018]!=0, "New", "No")