1 2 3 4 Previous Next 48 Replies Latest reply on Feb 20, 2017 11:02 AM by dominicjoannou

    Getting appropriate text from a field

    dominicjoannou

      Dear Filemaker Community,

       

      I have tried extracting very specific text from a field amongst a lot of other texts, many of them quite similiar using the command substitute. However, this was very cumbersome and did not work very well.

       

      I can extract specific text from a filemaker field when the field becomes a variable in Stata. I can create a dummy variable with the specific text in Stata. Creation of dummy variables seems to be relatively straight forward in Stata.

       

      For my own Filemaker learning how to do create a new field from an existing field with very specific text?

       

      Many thanks

       

      Dominic Joannou

        • 1. Re: Getting appropriate text from a field
          philmodjunk

          You cannot dynamically create a field in FileMaker from a script. You can create new records and you have a great many text functions other than substitute that can be used to extract (parse) text from text located in a field or variable. You can also find custom functions set up to make the parsing simpler if you search one of the websites set up for sharing custom FileMaker functions.

          • 2. Re: Getting appropriate text from a field
            dominicjoannou

            Dear Phil,

             

            Thank you for setting me on the right track. I can see that I should have rephrased my querry slightly differently.

             

            I would like to extract text from an existing field as part of creating a new field. I don't know whether this is called parsing.

             

            An example

             

            Existing Field

             

            Inappropriate boundaries client

            Inappropriate boundaries work colleague

            Serious concerns about basic clinical care

            ..... the list his long

             

            New Field

             

            Inappropriate boundaries work colleague

             

            New Field

             

            Inappropriate boundaries client

             

            New Field

             

            Serious concerns about basic clinical care

             

            ---------

             

             

            OK can can create new fields in Stata as what is called dummy variables, for event history analysis. But I would like to easily do the same thing with creating new fields as above in Filemaker, as it would set the whole dataset up for easily analysis in Stata.

             

            I prefer using Filemaker to Stata.

             

            Many thanks

             

            Dominic Joannou

            • 3. Re: Getting appropriate text from a field
              philmodjunk

              To repeat, you can't create fields within a table dynamically. That can only be done via Manage | Database.

               

              But what you call a "field" could be a record in a related table. Records in that related record can be created on an as needed basis and you can create as many as you need.

               

              You can also use set variable to put this text into variables so long as you don't need to store that information for later use--the variables disappear when the file is closed.

               

              In your example, GetValue could be used to return specific paragraphs of text.

               

              GetValue ( Table::ExistingField ; 1 )

               

              Would return:

              Inappropriate boundaries client

               

              I will also add the observation that the information you show entered into Existing Field would be better entered into a set of records, one record per statement, in the first place. Then no text parsing would be needed.

              • 4. Re: Getting appropriate text from a field
                dominicjoannou

                Hi Phil,

                 

                I have tried creating these new fields through manage database option from the existing field which is primary offence committed.

                 

                I have tried using

                 

                GetValue (primary offence committed; 2)

                 

                As inappropriate boundaries .. is number 2 on the value list.

                 

                It returns blank.

                 

                It seems that text parsing is quite a complex issue with Filemaker.

                 

                Many thanks

                 

                Dominic

                • 5. Re: Getting appropriate text from a field
                  philmodjunk

                  I think you have misunderstood. I have been trying to tell you NOT to add new fields, but to add new related records if there is supposed to be a flexible number of statements parsed from that text field.

                   

                  And why do you need to parse the text like this in the first place? Seems like there are better ways to handle this task that don't require any text parsing.

                   

                  and

                  ...is number 2 on the value list.

                  What value list? That's the first time that you've mentioned a value list.

                   

                  I suggest starting over by describing what it is that you want to do rather than ask about parsing text. Maybe you don't need to parse any text after all...

                  • 6. Re: Getting appropriate text from a field
                    BruceRobertson

                    Your will need to learn some basic things about database design and normalization.

                    It is not good practice to create new fields for this type of item.

                    It's data. You create new related records.

                    In a grocery ordering system you would not create a field for Milk; a field for Butter; a field for Eggs; etc.

                    These would be product records.

                    And in the grocery order; they would be related order items.

                     

                    Similarly, for review results or whatever this is about.

                    Exactly as Phil says; you create related records, NOT fields.

                    You would use the getValue function to grab each item from the text list; and determine whether it needs to be added to the related recordset.

                    text list to records.png

                    1 of 1 people found this helpful
                    • 7. Re: Getting appropriate text from a field
                      dominicjoannou

                      Dear Phil and Bruce,

                       

                      Thank you for your comments.

                       

                      You are right, I don't think I understood what you are trying to say.

                       

                      I have looked at the attached Filemaker file. There is one layout but two tables. One is inserting attributes from the attribute list individually into the related table. The attribute list has the attributes inserted into a single seperate field in the related table?

                       

                      Filemaker is very good at combining existing fields into a single field, other words concencating fields.

                       

                      I have time series data and also pooled cross sectional data.

                       

                      It seems that Filemaker easily do what can be done in Stata. Stata is a quantiative statistical software.

                       

                      An example of what I have managed to do in Stata is:

                       

                      gen IPRdummy = InterimRepresentationPresence=="Present and represented"

                       

                      This creates a new variable (field) in Stata from the existing field which has "Not present not represted", "Not presented but represetned", "Present", "Present and represented".

                       

                      People who are "Present and represented" have better outcomes compared to the other categories. So I wanted to test out Filemaker whether I could work on Primary Offence categories, which are many. Do some types Primary Offences have better outcomes?

                       

                      The difficulty with creating seperate fields for each category in a field would lead to thousands of different fields, just like seperating out the milk and eggs. One creates only selected fields (or variables in Stata), for categories that have high usage or where there seems a real difference in outcomes.

                       

                      Yours sincerely,

                       

                      Dominic

                      • 8. Re: Getting appropriate text from a field
                        philmodjunk

                        The difficulty with creating seperate fields for each category in a field would lead to thousands of different fields, just like seperating out the milk and eggs. One creates only selected fields (or variables in Stata), for categories that have high usage or where there seems a real difference in outcomes.

                        To repeat yet again, this is why Bruce and I have told you NOT to do that. You can create as many related records as you need and can statistically analyze/summarize the data in those records. Thousands of records are not a problem.

                         

                        I will also repeat my comment that putting this text all in one field only to have to parse the text back out into related records seems a very, very unnecessary way to do this. Better to log each incident in its own record from the start. Then no parsing is needed and you can generate statistical/summary values from the table of logged incidents.

                        • 9. Re: Getting appropriate text from a field
                          BruceRobertson

                          You asked how to extract a particular value from a return delimited list; and claimed it was difficult.

                          We have showed you that it is not difficult.

                           

                          What you have not done is describe anything remotely meaningful about the database system you are hoping to construct and the real entities and values you hope to represent.

                           

                          You have raised quite vague questions about variables, fields, attributes.

                           

                          You have mentioned this statement:

                          An example of what I have managed to do in Stata is:

                          gen IPRdummy = InterimRepresentationPresence=="Present and represented"

                          Possible values for this (variable? field?) are:

                          "Not present not represted", "Not presented but represetned", "Present", "Present and represented".

                           

                          Please discuss the database design issues in a more meaningful way.

                          Note that there are at least two possible ways to address the field/values question.

                          You can, in fact, use discrete fields; or you can use an EAV design.

                          Entity-Attribute-Value

                           

                          If EAV, then your statement above seems to be:

                          Entity: InterimRepresentationPresence

                          Value: (select one from possible values) "Not present not represted", "Not presented but represetned", "Present", "Present and represented".

                          • 10. Re: Getting appropriate text from a field
                            dominicjoannou

                            Dear Bruce and Phil,

                             

                            I have tried to follow your instructions. I have created a seperate field in a related table. I can now copy paste the offence category into the new field to go into a different table.

                             

                            This has really helped in a different way than what I originally expected. It has made me rethink what am I trying to achieve? Even though this is quantitative research, there is still a story. I want to use putting offence categories into another related table for exceptional cases such as the category of; serious or repeated medication errors, being the cause of death for the service user. (This has happened). In this table I sometimes write additional notes about some cases. An offence category in addition to the notes goes extremely well.

                             

                            In answer to Entity - Attribute - Value database, I started this database from the Container Start Up Package. This was because I knew that I would be working with hundreds and I now know with thousands of PDF case files. They needed to be readily accessible. Then I found that using a Name field in filemaker with unique entry actually improved the quality of my data entry onto Excel Spreadsheet. Then I started expanding the database to include more functions. Eventually I was able to abandon the Excel Spreadsheet data entry. The data entry onto Filemaker is so much easier than compared to Excel Spreadsheet. I do acknowledge that I need formal training on Filemaker, which I may try to arrange sometime later this year.

                             

                            All the Best

                             

                            Dominic

                            • 11. Re: Getting appropriate text from a field
                              BruceRobertson

                              Quantitative research.

                              Placing data into a data structure for "exceptional cases".

                              Not understanding data structure.

                              Hmmm.

                              Sounds like you kinda understand what happens when you hit a nail with a hammer but you don't understand architecture and can't describe what you're trying to build.

                              Is this a house? A kitchen remodel? A salad bowl?

                              • 12. Re: Getting appropriate text from a field
                                dominicjoannou

                                Hi Bruce,

                                 

                                I could write lots in response to the above message.

                                 

                                The database evolved!

                                 

                                It is a bit like the picture I have got now to represent myself. It is off stuffed peppers cooked with foraged wild orache leaves. Healthy food cooked very cheaply.

                                 

                                What I am trying to build or trying to achieve with the database:

                                 

                                1. For the database to produce Excel Spreadsheets for the indepth quantitative data analysis in Stata.
                                2. To be able to store and efficiently retrieve PDF case and Excel Spreadsheet data files.
                                3. I have found that Filemaker is excellent for monitoring time, with warning me when a sanction has expired. This is because I need to keep track of each case until they reach their final outcomes.

                                 

                                How to build, what to build, what architecture to use, I have had to find it out as I go along with Filemaker.

                                 

                                In answer about stories, one may want to give case examples of decisions that made, for instance the nurse that made the medication errors that caused the person's death was struck off the UK nursing register. Both you and Phil have helped me with seeing that Filemaker can help with this process with having the offence category added in conjuction with the notes that I do make for individual cases that seem to challenge expectations. But this particular story would be told as an extreme example in relation to many other different medication errors, along whether there is other behaviours such as dishonesty in covering up the mistakes and their final statistical outcomes. So this is an add-on rather than being one of the above objectives.

                                 

                                All the Best

                                 

                                Dominic

                                • 13. Re: Getting appropriate text from a field
                                  BruceRobertson

                                  Well; OK. But none of that information is very useful for the purpose at hand.

                                  To describe a database system as it may exist now; and as you might better design it for future use.

                                   

                                  What does your system do? Try to give a one sentence description.

                                   

                                  What does your ERD look like?
                                  What should it look like?

                                  What does your relationship graph look like?

                                  What should it look like?

                                   

                                  What tables and fields exist in it now?

                                   

                                  Creating a solution:

                                  FileMaker Pro 15 Help

                                  1 2 3 4 Previous Next