Jump to content

This topic is 8325 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I know this format below is incorrect, but it gives the idea of what I am after:

If(field1>0 & field2>0, "Yes") or

If(field1>0 & field2<1, "No") or

If(field1<0, "Empty", "")

It looks like it would work correctly, but doesn't. Does it make sense what I am trying to do?

LR

Posted

What you need is a case statement.

Case(field1>0 & field2>0, "Yes",

field1>0 & field2<1, "No",

field1<0, "Empty", "")

It allows multiple choices within a calculation. And it is easier to read.

HTH

Posted

Watch those ampersands. It should read:

code:


Case ( field1 > 0 and field2 > 0, "Yes",

field1 > 0 and field2 < 1, "No",

field1 < 0, "Empty" )

Note that the trailing "" (blank) is not required in a Case[] statement.

The "&" symbol is used to concatenate text strings. The "or" you had in your original calc also has a specific logical function.

Posted

You can nest a series of IF statements - but CASE is better. Using nested IFs, it would look like:

code:


If(field1>0 and field2>0, "Yes", If(field1>0 and field2<1, "No", If(field1<0, "Empty", "")))

Russ

This topic is 8325 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.