Jump to content

FMP 6 - Using or in If() calculations...


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

Recommended Posts

Hi

Is it possible to use the or operator in in calculations?

So if you have a calculation like this...


If( Status(CurrentUserName) = "James" or Status(CurrentUserName) = "John", "True", "False")

I've just tried it and it doesn't seem to be working.

I realise I could use Case() rather than nested If() statements, and I am doing so in the meantime.

But I just wondered why I couldn't get it to work.

Any ideas?

Thanks

Batfastad

Link to comment
Share on other sites

You can use "or" and any one of the logical operators with If(), Case() or any other function. It helps to remember that in FMP, True is 1, and False is 0. This allows some neat shortcuts in calcs, e.g. instead of:

Case ( a = b ; number ; 0 )

you can write:

number * ( a = b )

Link to comment
Share on other sites

Yeah I think I may have forgotten to switch the calculation to unstored.

Is there a limit to the number of 'or' operators you can have in an expression?


If(Name = "John" or Name = "James" or Name = "Mike" or Name = "Barry", "true", "false")

Thanks

Batfastad

Link to comment
Share on other sites

This topic is 6998 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.