2 Replies Latest reply on Feb 21, 2011 11:26 AM by philmodjunk

    Result of Calculation

    LukeCockell

      Title

      Result of Calculation

      Post

      Hi,

      There are instances where I'd like to display the result of a calculation. I have a system where I have a list of people, and some of those are marked as present in the building at a time. While the list is visible, I have buttons which execute a script and marks them as present if required.

      The list is a list view of the table of people are on the system.

      The two calculation result's I'd like showing are:

      1. Next to the name of the person, and the button that displays them as being present, I'd like to display whether or not they have been marked as being present. Simple text here would be adequate.

      2. In the footer of the list, I'd like to be able to display the number of people that are currently present.

      I come from an Access background so setting things up on FileMaker is very different and a learning curve for me. If there is something that requires clarification, please do ask. If what I'm requesting will not work directly, and suggestions from people would be useful.

      Many thanks,

      Luke

        • 1. Re: Result of Calculation
          Sorbsbuster

          We have a clock card system that shows a list of all the people who work in the building.  The screen is in two halves, left and right.  The left list is all the people who are out, and the right is all the people who are in.  As the people pass the clocking station they click their name and it moves them to be on the other list.

          There is a table of Staff.  It has a field StatusNow, which is either 'In' or 'Out'.  There are two other fields needed, calculations with a text result:

          ConstantOut = "Out"

          ConstantIn = "In"

          The two portals on the screen are by the relationships from the Staff Table to two other Table Occurances of the Staff Table (called StaffIn and StaffOut

          Staff::ConstantOut = StaffOut::StatusNow

          and

          Staff::ConstantIn = StaffOut::StatusNo

          You can have a calculation that counts the StaffID for each of those relationships and puts that total above each portal.

          • 2. Re: Result of Calculation
            philmodjunk

            1. Next to the name of the person, and the button that displays them as being present, I'd like to display whether or not they have been marked as being present. Simple text here would be adequate.

            This can be as simple as a check box field you click to mark them as present. The same field can both serve to mark them present and to report the fact that they are. More sophisticated approaches--including the example by Sorbsbuster are also possible, but thought you might find a really simple approach useful. And for a middle road, your script that marks people present can assign a value to this field.

            2. To get total counts, you can use a summary field with the "count of" option--just count a field such as the field I described in 1. that is empty if the person isn't present, but holds data if they are. This will work with portal records or the count of records shown in a portal can be computed with a calculation field defined in the parent table that uses the Count function.