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 5225 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I don't know if I'm having a major brain fart today, but I can't figure this out.

What I have:

Case( PatternCount( Type; "Receipt") = 0; Expense)

What I need is if the Type = "Receipt" OR "Mileage" to return 0 (False).... but I can't seem to figure it out

Can someone point me in the right direction?

-Thanks

-VX

Posted (edited)

Case( PatternCount( Type; "Receipt") = 0; Expense)

What I need is if the Type = "Receipt" OR "Mileage" to return 0 (False)

To add an additional criterion into what you are already doing, add some more conditions into your Case() leaving Expense as the default when no conditions are matched.

Case(

PatternCount( Type; "Receipt")>0; 0;

PatternCount( Type; "Mileage")>0; 0;

Expense

)

Since zero is considered false by FileMaker calcs you can shorten this to

Case(

PatternCount( Type; "Receipt"); 0;

PatternCount( Type; "Mileage"); 0;

Expense

)

If you find additional words in the future that also need a zero result, you can simply add extra conditions in the same format to the Case().

As Comment states above, if you are sure that Type is restricted to the exact values "Receipt", "Mileage", etc., you can remove the PatternCount() function.

Case(

Type="Receipt"; 0;

Type="Mileage"; 0;

Expense

)

Edited by Guest
Posted (edited)

Wow, I didn't even think to use a reversed statement. I'll have to keep that in mind for future calculations. Thanks, I appreciate it.

Tom, thanks for that as well. The rules of this database change from time to time so adding additional "Types" might occur. Adding another condition is easy enough, I was just having HUGE brain fart. I'm on a low carb diet and I feel kinda hazy.

Edited by Guest
Posted

I guess what you want is:

case ( not PatternCount( Type; "Receipt") or not PatternCount( Type; "Mileage") ; "Expense" )

This shorter form also works, since zero is interpreted as boolean false, and any other (positive) value as true.

Hope this helps.

Posted

I guess what you want is:

case ( not PatternCount( Type; "Receipt") or not PatternCount( Type; "Mileage") ; "Expense" )

This shorter form also works, since zero is interpreted as boolean false, and any other (positive) value as true.

Hope this helps.

That's what I was attempting to use but I wasn't working. I'm not sure what was going on...

Posted

Case( PatternCount("Receipt Mileage"; type ) = 0; Expense)

Posted (edited)

If you have many values to check, you can switch to something like:

IsEmpty ( FilterValues ( Type ; "Receipt¶Mileage¶Another" ) )

---

P.S. Beware of PatternCount() in these situations; it can easily return a "wrong" result when one value contains another, e.g. "Receipt" and "Not a Receipt".

Edited by Guest
Posted (edited)

Ya, That's why I changed it to your initial suggestion where you dropped the Pattern Count.

Furthermore I decided to make the field contain a drop down list and is validated by that value list. So the field values are limited, but you make a good point.

Edited by Guest
Grammar

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