April 27, 200421 yr 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.
April 30, 200421 yr 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.
May 5, 200421 yr 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
May 6, 200421 yr 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 "
May 6, 200421 yr 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","") & "
May 6, 200421 yr Here's a similar solution that keeps the order of the list as well as the spacing. Thanks! Paul Revised Report.zip
May 10, 200421 yr 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 ). 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.
May 10, 200421 yr 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
May 11, 200421 yr Grrrr... I'm working from home for a week, and don't have FM, but I want to know how to do longer lists! No trial and error for me! Paul
May 12, 200421 yr This particular calc is quite readable for virtually any length list. It is simply one line per value. I've seen plenty worse.
Create an account or sign in to comment