1 2 Previous Next 21 Replies Latest reply on Sep 16, 2011 8:25 PM by Sanyi

    text operator

    Sanyi

      Title

      text operator

      Post

      I am kinda new to filemaker here. I am trying to filter out an inventory list of items by big or small. So I created a field called category with big and small value. I made a portal then specify filter portal record by category. Now I am not sure how to script it, I put something like "InventorybyCatalog::Category = Big" but it gives me and error. Also not sure if this proper way to filter out. Thank you in advance.

        • 1. Re: text operator
          philmodjunk

          If you are selecting or entering "Big" in the InventorybyCatalog::Category field to designate the "big" items, use this expression:

          InventorybyCatalog::Category = "Big"

          Note the use of quotation marks.

          • 2. Re: text operator
            LaRetta_1

            To add a bit ... portal filtering will produce records if the calculation test returns true; it is Boolean test.  There is no script.  Filtering happens on portal setup.

            - - - modified (late night)

            • 3. Re: text operator
              Sanyi

              It kept showing me empty field. I am not sure if I do this correctly. It seems that I can only pull data from related table. I am not sure what does this do but I went on to create new table called "inventory 2" where the data source is from "inventory". Then I made new relationship between them by defining item = item. Then I created a portal and specified filter condition by defining InventorybyCatalog::Category = "Big", and show related record set to inventory 2. Then add Category and item fields to the portal.

              Can someone explained what went wrong and what is the function of creating related table? Thanks again.

              • 4. Re: text operator
                Sanyi

                After playing around for a few hours, it works now but after filtering, the filtered data is shown as an empty line with a list view. Is there a way to truncate the empty line?

                • 5. Re: text operator
                  LaRetta_1

                  Please upload your file somewhere and provide a link to it here in a response and include name of layout you are working on and name of value list, field etc.  :^)

                  • 6. Re: text operator
                    Sanyi

                    http://dl.dropbox.com/u/14872479/Filtering%20study.fp7

                    I am trying to filter out by "Sample_type" field on "Filter" layout. Two issues after filtering I see right now are 1. It returns same value on "Name" field and 2. It doesn't truncate empty line after being filtered out.

                    I check some of the starter solution templates and it uses a calculation field. I guess I am still trying to understand how tables relationship works.

                    Thanks.

                    • 7. Re: text operator
                      LaRetta_1

                      You cannot use a table or list layout of Main to display related records (which is what you were trying to do).  We need to know the purpose of why you want to filter the information (what is the User wishing to accomplish) and also it will help to know your FM version.

                      In general, you need to place a portal on Main and display within the portal, fields from SortMain.  In this way, if you are on a Main record with Sample Type = "Made", then all other records that are also 'made' will appear in the portal.

                      If you wish to see the result as a list then, from Main, you will need to use Go To Related Records.  Since this is known as a 'self-join', you can stay on same layout if you wish or go to another layout based upon Main table occurrence.  From Main, script step would be:

                      Go To Related Records [ from SortMain ; using 'current layout' or layout based upon Main ] ... specify match 'current record' only.

                      • 8. Re: text operator
                        Sanyi

                        I have fm11. I made this database to try to see how portal works.

                        What I am trying to accomplish is to make "Main" layout as data input only while the "Filter" layout is to view sample by "Sample_Type". I was going to use something like drop down menu that user can choose to view what kind of "sample_type" but I wanted to understand how portal filtering work first.

                        • 9. Re: text operator
                          philmodjunk

                          You might want to read this tutorial: Tutorial: What are Table Occurrences?

                          What LaRetta is suggesting is that you use one table occurrence of your table for the layout and a related occurrence of the same table for your portal. This tutorial explains Table Occurrences and how they control the function of a fileMaker Pro database.

                          • 10. Re: text operator
                            LaRetta_1

                            But what you showed is not portal filtering - it is relationship filtering and showing the results in a portal.  Since you have vs. 11, you can use portal filtering instead but again, we have no real concept of what you are trying to accomplish. 

                            What are you showing your Users?  Do you want them to see a list of 'other inventory items also assigned to same Sample Type?  If you want users to see such a list then the relationship (or portal filter) should be based on a GLOBAL text field where users will select the Type via pop-up list attached to value list based upon Sample Type.

                            So you may want a portal or you may only need a global field.  You may want to use a filtered relationship, or you may want to display in a portal ... or you may want to present other 'sample types' in a pop-up menu.  I am not sure what a User is doing in Inventory anyway - since they usually work at the Invoice/Lineitem level.  Is this for Users to select the Sample Type and THEN get a list of those Products?  If so, you need a conditional value list so that, once a User selects the type, Products are filtered down to show only those products with the same type.

                            My point is that purpose and context are king.  Any design will depend upon these two items and no solution will be right unless these are understood during the design phase.  All in all, Sanyi, the proper relationship must be established first.  Once the structure is correct, only then should one consider the UI requirements.

                            • 11. Re: text operator
                              Sanyi

                              PhilModJunk - Thanks, now I have better understanding.

                              LaRetta - Sorry if my post wasn't clear enough. I will quote this part from your 3rd paragraph which what users really want.

                              Is this for Users to select the Sample Type and THEN get a list of those Products?  If so, you need a conditional value list so that, once a User selects the type, Products are filtered down to show only those products with the same type.

                              • 12. Re: text operator
                                LaRetta_1

                                http://fmforums.com/forum/topic/40834-clear-related-value-lists/page__p__190602#entry190602

                                http://fmforums.com/forum/topic/52209-conditional-value-list-with-self-clearing-fields/page__p__330569#entry330569

                                The first is two-tiered self-clearing conditional value list example by Comment.
                                The second is same but three-tiered.

                                The beauty about the options self clearing is that, if User changes their mind, the values reset. 

                                • 13. Re: text operator
                                  Sanyi

                                  Hmm been trying to recreate the first example but for some reason it won't get filtered by primary selection (selectsample in my file). Pretty sure I follow everything except the naming.

                                  http://dl.dropbox.com/u/14872479/Filtering%20study.fp7

                                  If someone could take a look, I would really appreciate it.

                                  And by the way, took me sometime to figure out that I need to create a record on second table before the drop down will work. Not sure why it works that way.

                                  • 14. Re: text operator
                                    LaRetta_1

                                    Open your value list for Name.  Go into the field spec and look on the bottom.  It needs to be enabled as "Include only related values" and specify select in the bottom pop-up to use Values 2.

                                    And you need to attach the pop-up menus to those fields.  Once you get them working reinvestigate those files again (2- and 3-tiered self-clearing) to see how to keep the display 'in synch' - check their auto-enter (replace) calcs.

                                    1 2 Previous Next