Jump to content

Conditionnal calculated fields with related fields


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

Recommended Posts

Posted

Is it possible to calculate with a condition on a relate field?

Lets says table B is a product table which has a category field, a price field and a foreign key to a record in table A. The category can be X, Y, Z. Each product has a pr

Table A is let say a bill table (I know that's not the way it should be, it's only an example).

Is it possible in table A to create a sum field of the price all the products which belong to category Z?

In SQL, it would look like

SELECT Sum(tableB.Price)

FROM tableA INNER JOIN tableB ON tableA.pk = tableB.fk

WHERE tableB.categoryID = 'Z'

Posted

If you create a global text field and then create a new relationship to another table occurence of TableB, you can join on tableA::pk = table::fk AND tableA::gCategoryID = tableB::categoryID.

Now all you have to do is set the gCategoryID global field with "Z", "Y", whatever and you can now get the total.

If this is not for browse mode and you want to just display it in a report, then you can use a summary report which has been contrained to "Z"

Posted

That solution seems good.

I'm not very aware of all the "not too" relational db trick in Filemaker.

This topic is 6016 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.