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

Displaying non-selected items of a checkbox


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

Recommended Posts

Posted

Hello. I have a field "paperwork" that contains a check box value list. An user uses this to check off certain pertinent paperwork as it is received. She wants a report that displays, side by side, reports received vs. reports still pending. My question is: How do I create a field that will display items NOT selected in the "paperwork" value list? Here is a screenshot for your reference:

Thanks in advance.

screenshot.gif

Posted

There has to a better way but -

Set Field(Pending1) = case(PatternCount(StatusField, "Vacation Packets") = 0, "X","")

will put an 'X' in Pending1 if Vacaion Packets haven't been completed. And so on for the other reports.

Posted

Here is a solution for you. It uses two fields: Completed_Reports and Reports_Pending. Completed_Reports is just a text field. I set it up to use the value list you listed in your question. Reports_Pending is an unstored calculation that uses the following (fairly ugly) If statements:

If(PatternCount( Completed_Reports, "Vacation Packets" )=0,"Vacation Packets

Reports Pending.zip

Posted

I find nested Case statements much easier than nested If statements, especially complex ones. And yours aren't nested.

Your solution will work with Case instead of If.

By the way, I think you need a "

Posted

I've always been a little sketchy when it comes to nested case statements, so my solution used ordinary "If" statements. I tried to use one Case statement originally, and it just returned the first matching value. Essentially, instead of this

Case(PatternCount(Completed_Reports,"Vacation Packets")=0,"Vacation Packets","") & "

Posted

I like the way you remove the left hand items. Not sure if that is what Panache wanted. (Are you still there , Panache?)

Our Case and If solutions are identical (except mine's better smile.gif).

A nested Case will only return one value as a rule - same as nested Ifs.

In every other language I've ever looked at, the BIG difference between Case and If is that If is sequential - it tries each test in turn, starting with the one you coded first - while Case provides no guarantee of sequence. In FMP, however, I'm told Case is sequential also. Hence the only difference is that nested Cases are easier to read - I think.

Posted

I wonder how readable the calc would be if you were to deal with related lists or some longer custom lists.

Repeating field could be an alternative for long custom lists, prior to FM7 solutions.

See attached a small example.

As this was also covered some days ago, you may also have a look to some other samplers provided here on this list.

-Vaughan's portals

-Using GetField() limited to one way checks

Which method you'd be using would probably depend upon the number of values, and if you'd re-use the available list afterwards (as a list, which therefore means it has to be stored or scripted).

Availables.fp5.zip

Posted

This particular calc is quite readable for virtually any length list. It is simply one line per value. I've seen plenty worse.

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