6 Replies Latest reply on Aug 11, 2009 2:45 PM by philmodjunk

    Creating fields tht behave as globals within a group

    ocolamonici

      Title

      Creating fields tht behave as globals within a group

      Post

      I am not sure that what I want to do is "doable" in FMP.  I have a database that groups data based on one field designated, for example, as "Group".  Each group can have data for up to 6 independent user-defined parameters termed "Parameter 1", "Parameter 2"....  The Parameters 1-6 for Group A can be different than the Parameters the user selects for Group B. For example, the user may assign "fruits" and "vegetables" for parameters 1 and 2, respectively, in Group A; while parameters 1 and 2 may correspond to "drinks" and "sandwiches" in Group B.  If all the groups were using the same parameters, this issue would be addressed by using global fields, so parameter 1 would the same for all groups, and once it is selected, it would show up in all records regardless of the group..  What I would like to do is to have sort of a "local global" in which parameter 1, 2, 3... show up the same for all the records within Group A, while they are different for other groups.

      Is there a way to do this?

      I'd appreciate your help.

      Best,

      Oscar 

       

        • 1. Re: Creating fields tht behave as globals within a group
          philmodjunk
            

          Key question: Do these group globals need to behave like globals do in a networked environment? In otherwords will each person that accesses the database need their own personal set of these global values?

           

          Let's assume that this is not the case for the moment. In that case, it sounds like you simply need to set up a related table of values. Presumably, you have a field that identifies which records belong to a given group. Use that field as your key and you can relate the group of records to a single related record where each field is one of your parameters. Each group can then get it's own unique set of values.

          • 2. Re: Creating fields tht behave as globals within a group
            comment_1
              

            It's possible, though with some limitations applying to displaying the data. Basically, you need three (or perhaps four*) tables for this: Groups, Parameters (a child of Groups) and Values. Values is a join table - each record holds the value for Group x, Parameter y.

             

             

            Can't see the analogy to globals, BTW.

             

             

            ---

            (*) It's not quite clear how many members a group can have.

            • 3. Re: Creating fields tht behave as globals within a group
              ocolamonici
                

              This fields have to behave as global within a network (the Group).  I just want to keep consistency so, once the value of these parameters are established, the users can enter values in other fields which will be used for reports (i.e.mean and SD).    Following the example we are using, the layout has, in addition to the Group, a field that will determine the "Store"; a field for the item to be sold (parameter 1=sandwiches in Group A) and finally, fields that contains the "Date" and the "number of sandwiches sold".   This will allow me to estimate the mean and SD of sandwiches sold in a given day by the different stores in group A (this is a simplified example because in reality I am using this to analyze genetic data).

              My goal is that once parameter 1 and date are established in one store record in Group A, they will be the same and show up automatically,as a global, in all the store records for group A, so, I can do the statistical analysis. 

              • 4. Re: Creating fields tht behave as globals within a group
                philmodjunk
                  

                "The fields have to behave as global within a network (the Group). "

                I can't tell if you understood my question or not. With global fields if two users are accessing a shared database at the same time, each gets their own "virtual copy" of that field and the values in those fields revert to their original value when a user disconnects from the database. Example: User 1 logs in to layout with the global field "state" on a layout that currently shows "Nevada". They change the value to "California". At the same exact time, User 2 connects. User 2 will also see "Nevada" in the field. This user enters "Maine". The change made by User 2 will be invisible to User 1 and vice versa. In both cases, the global field will revert back to "Nevada" when the user quits the database.

                 

                Do you need this behavior in your "Global to a Group" fields?

                • 5. Re: Creating fields tht behave as globals within a group
                  ocolamonici
                    

                  Phil,

                  Sorry, I misunderstood your point.  The answer is, no.  This solution will not be accessed through a network.  I just need these fields to behave as globals within the group.

                  Oscar 

                  • 6. Re: Creating fields tht behave as globals within a group
                    philmodjunk
                      

                    That simplifies things. Either Comment's or My suggestions should work for you.

                     

                    I was assuming you had a static number of parameters for each group and thus one related record could hold all the values with each group parameter stored in a separate field in the related record. If you need to support a more flexible number of parameters for a given group, I'd then use Comment's approach.