Jump to content

filter + self-join + portal = confused


toddj

This topic is 6522 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi

I'm trying to display in a portal, a subset of a table's records, based on a calculation.

pseudo code: if itemQty is =< minimumAllowed, then display that record in the portal.

What is a simple way to do this?

Link to comment
Share on other sites

You need to create a calculation key field in the child to only have a value when your condition is true. It could match a "constant" in the parent, or it could produce the portal's main key itself. Examples:

Case ( itemQty <= minimumAllowed; 1 )

That would match a Constant, = 1 field in the parent, which you'd add to the portal's relationship.

Case ( itemQty <= minimumAllowed; key field )

That would match the portal's parent key field itself (which you haven't told us, hence I can only do generic).

Link to comment
Share on other sites

Thanks Fenton.

What is confusing me is the self-join nature of the relationship. I want the portal to contain the same (low_qty) items (from the same table) regardless of which record I'm viewing.

Also, I'm a bit thrown-off by FileMaker's recent change in portals referencing related tables rather than the relationship itself, as they used to. It's been a couple years since I used Filemaker (v5). I'm pretty slow about these things. I'll catch on eventually.

Link to comment
Share on other sites

If you want to always see the same thing, then use a "constant" calculation field on the "left" side, and the calculation that produces a 1 on the other. As long as there's >0 found set, the relationship will be the same (relationships don't work when there's a zero found set). Whether it's a self-relationship or not makes little difference.

Link to comment
Share on other sites

This topic is 6522 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.