1 Reply Latest reply on Nov 10, 2014 9:31 AM by philmodjunk

    Script help please?

    DavidKing

      Title

      Script help please?

      Post

      Hi all,

      I am running Filemaker Pro Advanced 13 for Windows.

      I have a database which is for basketball, and a key field which is a text field made up of Date & Venue & Game number.

      It is only a flat file database at the moment.

      I can rank the players by games played at all venues, in this particular game, using a script that sorts by Key and Games Played and looping a running count and restarting the summary for each sorted group.

      However, I want to have the minimum number of all games played by a player in a script based on the sorting of the key field and games played in ascending order.

      In other words, I can't do it the way of a ranking script because, there is no option to restart the summary for each sorted group when you use the Minimum option.

      Example:

      I would like to have the date venue and game number list of players, (which I already have), but need to have the minimum number of games ever played by a player next to each player in a script.

      So if the minimum number of games played by any player is 3, then 3 is placed in a field next to all players for that game, based on the key field.

      I would like an automated script because there are hundreds of games and players.

      I have the rankings and they work perfectly in a script.

      Any ideas of help most appreciated.

        • 1. Re: Script help please?
          philmodjunk

          Problem #1:

          and a key field which is a text field made up of Date & Venue & Game number.

          This data should be recorded in 3 different fields, only one of which would be a text field. The other two would be a date for the date and a number for the game number.

          Problem #2.

          It is only a flat file database at the moment.

          FileMaker is a relational database system for a reason and if you don't take advantage of that capability, your ability to work effectively with this data will be severely limited, prone to error and very inefficient.

          You describe data that really should be in at least three related tables, Games, Players, PlayerStats.

          Players----<PlayerStats>------Games

          Players::__pkPlayerID = PlayerStats::_fkPlayerID
          Games::__pkGameID = PlayerStats::_fkGameID

          Your minimum figure can easily be calculated from a calculation field defined in the players table by using the count function to count the number of related records in PlayerStats.

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