Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I need to calc a field based on the current date. Here is the criteria:

If the date_active > today then "preliminary"

If the date_active < or = today AND the date_owo = 00/00 then "active"

If the date_active < or = today AND the date_owo > today then "active"

If the date_active < or = today AND the date_owo < or = today then "inactive"

Here is what I have, but it's not working right.

Case (

date_active > Get ( CurrentDate ) ; "preliminary" ;

and ( date_active ≤ Get ( CurrentDate ) ; date_owo = "00/00" ) ; "active" ;

and ( date_active ≤ Get ( CurrentDate ) ; date_owo > Get ( CurrentDate ) ) ; "active" ;

date_owo < Get ( CurrentDate ) ; "inactive" ;

)

thanks in advance

Posted

In Filemaker, 'and' is an operator, not a function. Try:

Case (

date_active > Get ( CurrentDate ) ; "preliminary" ;

date_active ≤ Get ( CurrentDate ) and date_owo = "00/00" ; "active" ;

date_active ≤ Get ( CurrentDate ) and date_owo > Get ( CurrentDate ) ; "active" ;

date_owo ≤ Get ( CurrentDate ) ; "inactive"

)

This could be shortened to:

Case (

date_active > Get ( CurrentDate ) ; "preliminary" ;

date_owo = "00/00" or date_owo > Get ( CurrentDate ) ; "active" ;

"inactive"

)

NOTE: If date_owo can be "00/00", then date_owo is NOT a date field. And if date_owo is not a date field, then the comparison with current date will not work.

Posted

Will it work if the owo is left blank? That is a termination date that will not be filled in until that decision for that particular product is made.

thanks

Posted (edited)

Thanks,

I'm updating the records now, At this point it is showing all files as inactive. I am going to play with it a bit more, but if you have any thoughts they are welcome.

I have the following:

Case (

date_active > Get ( CurrentDate ) ; "preliminary" ;

date_owo > Get ( CurrentDate ) ; "active" ;

"inactive"

)

They have just asked me to add a "cancelled" designation that would be triggered manually. What would be the best way to set that up? I was thinking about adding a step field that would house the calc. above, and then in the status field do a new case that would look for the "cancelled" input, and if not then revert to the step field with the "active" "inactive" results. Does that seem right, or is that too cumbersome?

thanks,

mike

Edited by Guest
Posted

The Case() function returns the result attached to the FIRST TRUE test. So if I understand correctly, you can simply add this as your first (overriding) test:

Case (

Cancelled ; "cancelled" ;

date_active > Get ( CurrentDate ) ; "preliminary" ;

not date_owo or date_owo > Get ( CurrentDate ) ; "active" ;

"inactive"

)

'Cancelled' can be a number field switched between 1 and 0/empty, or (preferably) a date field.

Posted

It's not working though. While I was testing, as a text field, with "yes" typed in, it would show "cancelled", but as a date field, it just reverts to "inactive", "active" or "preliminary".

What did I do wrong?

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