8 Replies Latest reply on Feb 1, 2015 4:00 PM by Billyboyo2004

    Count script and a total.

    Billyboyo2004

      Title

      Count script and a total.

      Post

      I have a list of competitors which varies with each event. I wish to allocate prizes to each event, but i don't know how to write the script. It would go some thing like this.

      Count number of contestant 1....28 (28 being the maximum number of contestants)

      if count = or < 3 then first prize

      if count = or <  7 then second prize

      if count = or > 7 then 3rd prize

      I would need then to be able to total the $value of the event.

      The initial layout would have a list with the prize money entered. eg: First Prize $10 Second Prize $8; Third prize $5.

      Thanking you

      Billy

       

      Screen_Shot_2015-01-28_at_1.28.28_pm.png

        • 1. Re: Count script and a total.
          AppGuy

          We will need a bit more information to help you out.  Can you post your table relationships?

          and can you be a bit more specific around what fields you are looking to count and where is this event value stored?

          also if you have a script started post it to please..

          • 2. Re: Count script and a total.
            philmodjunk

            This starts with a functional data model--a system of fields organized into tables linked to other tables via relationships.

            A typical data model for what you describe would start with something like this:

            Contestants-----<Contestant_Event>-----Events

            Contestants::__pkContestantID = Contestant_Event::_fkContestantID
            Events::__pkEventID = Contestant_Event::_fkEventID

            You can place a portal to Contestant_Event on the Contestants layout to list and select  Events records for each given Contestants record. Fields from Events can be included in the Portal to show additional info about each selected Events record and the _fkEventID field can be set up with a value list for selecting Events records by their ID field. Any statistics recording a contestant's performance in a given event would be recorded in fields define in Contestant_Event.

            For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

            This just lays the goundwork for what you need before you can start talking about what First Place and Prize Money issues.

            Caulkins Consulting, Home of Adventures In FileMaking

            • 3. Re: Count script and a total.
              Billyboyo2004

              Hi and thanks for answering

              I have attach a picture of the page I am using. There is 700 different events in this section.

              1. I have set up a page with contestants contact details.

              2. I then have a page with their entry details eg: event entered entry fee etc.

              3. I then enter the details into the page below.

              In an ideal world I would like the program to be able to do step 3 from step 2 automatically but it is well beyond my ability so this is the best I can come up with.

              What I am trying to achieve here is to work out the amount of prize money for each event. As per my post the number of competitors will determine the amount of prize money required

              • 4. Re: Count script and a total.
                philmodjunk

                To repeat, before we can discuss layouts, you need a workable data model. From  what I can see on that layout, this is not something you have in place yet. The list on the left hand side of your layout is something usually implemented with multiple related records in a portal rather than a set of individual fields.

                • 5. Re: Count script and a total.
                  Billyboyo2004

                  Hi

                  Please find relationship plan. Had to tidy it up a bit before I posted

                  • 6. Re: Count script and a total.
                    Billyboyo2004

                    Hi

                    Please find relationship plan. Had to tidy it up a bit before I posted. I would love to use a portal but l haven't been able to get it to work. I am only new to this type of program and although I have attended a couple of workshops to learn filemaker  I am still a long way from being able to fully understand how it works.

                    • 7. Re: Count script and a total.
                      philmodjunk

                      And which of these table occurrences (the boxes shown in your screen shot) are the basis for your layout?

                      You have multiple fields in Music and Contestants that should be replaced with a related table and (most probably) a portal.

                      "Couldn't get it to work", unfortunately, is too vague for me to provide much help to you at this point as I don't know where it failed for you. The problems that I have noted in your data model, however, may explain why you couldn't get a portal to work. I suggest comparing your set up to mine. You can't just copy mine as you have additional details covered in your data model, but note how it manages a table where each contestant can compete in multiple events and you can record results for each contestant's participation in each event and it can do so for any number of contestants.

                      • 8. Re: Count script and a total.
                        Billyboyo2004

                        Hi Phil

                        Your layout or design is not available to me.

                        Billy