3 Replies Latest reply on Aug 7, 2014 9:08 PM by philmodjunk

    [Beginner] Filter portal expression



      [Beginner] Filter portal expression


           Hello all, newbie here!

           I am trying to do a simple solution so I can learn FileMaker. The solution consists in having a database where I can keep Football Matches between teams. Besides Matches and Teams, I also have a Users table. From users context I want to display all kind of information. Like played matches, matches won etc.

           After I succeeded with played matches, I wanted to apply a filter so I can see just the won matches.

           You can see my table relationships in the attached picture.

           The problem is that my expression doesn't work.

           Full expression :

           If ( ((User_Match::_homeUserId = User::__userIdPk)  and  (User_Match::home_goals > User_Match::away_goals))  or ((User_Match::_awayUserId = User::__userIdPk)  and  (User_Match::away_goals > User_Match::home_goals)) ; 1 ; 0)

           Simple test expression

           If (User_Match::_homeUserId = User::__userIdPk ; 1 ; 0)

           None of these works. I suppose I am wrong regarding the "User::__userIdPk" ? I want to use the current record userIdPk. Isn't this the correct way to do that ? What would be the correct approach?




        • 1. Re: [Beginner] Filter portal expression

               Context is critical.

               Clearly you have a portal But to what table occurrence? (A "table occurrence" is a box in Manage | Database | Relationships that represents a table in your database.) I think that I see at least two different occurrences of your Match table, but I'm guessing here and that doesn't tell me which, if either of those two are specified for your portal.

               And then your layout will be based on another of these table occurrences. The relationship linking the layout's table occurrence to the portal's is the first key detail that I must know. In Layout Setup..., what table occurrence is specified in "Show records from"?

               I'd guess that your layout is probably based on "User", but prefer not to guess.

          • 2. Re: [Beginner] Filter portal expression

                 Hi Phil,

                 Thank you for you reply.

                 Layout is User Table, the portal should be from User_Match TO.

                 I already solved this. It was a problem with the data inside Match table. I was using some Popup-Lists to select home/away users and instead of adding the id, the User name was added.

                 Thank you, is there anyway I can mark this thread as solved ? Or there is no need for that ?

            • 3. Re: [Beginner] Filter portal expression

                   No real need but you can always select your last post as the "best answer". wink