Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a calculation using the position function to scan a field for certain verbiage. The calculation is exactly as follows:

If ( Position ( ReportType; "URAR" or "multi" or "SFR" or "condo"; 1; 1) ≥ 1; "Full Report"; If( Position ( ReportType; "Desk"; 1; 1) ≥ 1; "Desk Review"; If (Position (ReportType; "Field"; 1;1) ≥ 1; "Field Review"; "Other")))

In my data, one of the possible field values is "Final Inspection - 1004D" that returns "Full Report" for the calculated field. Can anyone give me some idea how this is possible? Shouldn't it be an "Other"?

Posted

The expression:

"URAR" or "multi" or "SFR" or "condo"




evaluates to 0 (False), because none of the words are True. And since 0 does appear in "Final Inspection - 1004D"...



Try something like =




Case ( 

Position ( ReportType ; "URAR" ; 1 ; 1 )

or

Position ( ReportType ; "multi" ; 1 ; 1 )

or

Position ( ReportType ; "SFR" ; 1 ; 1 )

or

Position ( ReportType ; "condo" ; 1 ; 1 ) ; "Full Report" ;



Position ( ReportType ; "Desk" ; 1 ; 1 ) ; "Desk Review" ; 



Position ( ReportType ; "Field" ; 1 ; 1 ) ; "Field Review" ; 



"Other"

)

Posted

The expression:

"URAR" or "multi" or "SFR" or "condo"

evaluates to 0 (False), because none of the words are True. And since 0 does appear in "Final Inspection - 1004D"...

say what? if I'm understanding correctly, because my result for my first test is 0 (zero), and 0 (zero) appears in my data, it's now TRUE...and thus "Full Report"?

Posted

No, not exactly. Your first test is:

Position ( ReportType; "URAR" or "multi" or "SFR" or "condo"; 1; 1) ≥ 1




This test evaluates as True, that's why you are getting the first result - "Full Report". 

I was trying to explain why the test evaluates as True. 



To make a long story short, you cannot use "or" this way; you must place the "or" operators in-between STATEMENTS, not between ARGUMENTS.



For example, this is correct:




A = B or A = C




but this:




A = B or C

makes C a statement on its own. The result will be true when A = B OR when C by itself evaluates as True (e.g. when C is a number other than zero).

Posted

No, not exactly. Your first test is:

Position ( ReportType; "URAR" or "multi" or "SFR" or "condo"; 1; 1) ≥ 1




This test evaluates as True, that's why you are getting the first result - "Full Report". 

I was trying to explain why the test evaluates as True. 



To make a long story short, you cannot use "or" this way; you must place the "or" operators in-between STATEMENTS, not between ARGUMENTS.



For example, this is correct:




A = B or A = C




but this:




A = B or C

makes C a statement on its own. The result will be true when A = B OR when C by itself evaluates as True (e.g. when C is a number other than zero).

I see what you mean. My mistake. Thank you!

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