Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi, I have what should be a easy question to answer.

What does "Evaluate this calculation from the context of: TableName" mean?

I would understand this to mean perform this calculation using this TableName and related tables.

The only problem is if the TableName is not related to the TableName used by the current layout, the "context" is unavailable. As a result, I fail to see the point, and do not understand how to accomplish these "isolated" calculations.

Thanks to anyone who might have some insight into this problem.

Bill

Posted

Calculations are added into tables. They usually evaluate from the first occurrence created (and named) which is usually the primary occurrence. But if you have another table occurrence of the same table off somewhere else in your graph which has related tables, you can specify the calculation to go 'stand' on THAT occurrence and perform its evaluation.

So if you have a table occurrence group which consists of of Current_Customers (customers table) and it has related Sales_Rep (staff table) then you can write a calculation which makes this evaluation look at this relationship to grab the information without you having to create a Sales_Rep (staff table) and attach it directly to your original customers table occurrence.

You can have two calculations which each are evaluated from different table occurrence groups but, because their perspective is different, you will end up with different calculation results.

If you wish to provide a specific situation(and a copy of your graph or a sample file), we could show you more specifically what we mean. :smile2:

Posted

Thanks for replying so quickly.

Currently, I am attempting to setup a self-maintaining serial number field. I am trying to use a summary field to give me the current maximum value and then add one.

The problem is I rarely have access to the same table occurrence, and as a result the summary field comes back empty. If I am to able to specify the context that is always used, this would work.

It would appear that I attempting to use this in a different way then it was intended be used.

Bill

Posted

"I am attempting to setup a self-maintaining serial number field."

Don't go there. Use FM's auto-enter serial numbers.

Posted

Yes, I am finding that out.

But, it would still be nice to completely isolate a calculation. Oh well.

Thanks for the help.

Bill

Posted

Yes, I am finding that out.

But, it would still be nice to completely isolate a calculation. Oh well.

Thanks for the help.

Bill

What does it mean to you to "isolate a calculation"?

Also, are you performing this calc in a script or a field definition? If this is a field definition, then the context is available to you. There really is no problem here.

Posted

Actually, I was looking for a way to calculate a value based only on the table. No matter which script was running, mostly having to do with the summaries of all records.

I find it useful to have these independent calculations, for now I have I written scripts which act as "functions" and return the value. But it would more efficient, I think to have this in the table design.

Who knows, maybe this will be in a future version.

Bill

Posted

Actually, I was looking for a way to calculate a value based only on the table. No matter which script was running, mostly having to do with the summaries of all records.

I find it useful to have these independent calculations, for now I have I written scripts which act as "functions" and return the value. But it would more efficient, I think to have this in the table design.

Who knows, maybe this will be in a future version.

Bill

Well, that doesn't help much. What are you really trying to do? Can you give a concrete example or post an example file? So far I haven't heard anything that can't be done right now.

Posted

The only problem is if the TableName is not related to the TableName used by the current layout, the "context" is unavailable. As a result, I fail to see the point, and do not understand how to accomplish these "isolated" calculations.

The "Evaluate this calculation from the context of: [___]" parameter applies ONLY to related values referenced in the calculation.

To give a somewhat arbitrary example, suppose you have two tables with two relationships between them:

Table A::Firstfield = Table B::Firstfield

Table B::Secondfield = Table A 2::Secondfield

A calculation field in Table A defined as =

List ( Table B::Thirdfield )

will return a list of values from records in Table B related by Firstfield, when evaluated from the context of Table A. If the same calculation is evaluated from the context of Table A 2, it will use the second relationship and list only records that are related by Secondfield.

But an "isolated" calculation using only local fields, such as:

Somefield + 5

will always return the same result, no matter from which context.

Posted

Ok, I see where the confusion is.

By "isolated" I wasn't referring to just something like: Somefield + 5, or even Somefield1 + Somefield2.

But rather: Somefield1 + Summaryfield1, from the same table.

I have feeling this is where I am having the problem, with Summaryfield being always reevaluated based on the current context.

Bill

Posted

Summary fields summarize the found set. Each TO can have it's own found set (actually, several found sets, if you have more than one window open), so this calculation is definitely depending on the context.

If you want a summary that ignores the found set, you need to define a self-join relationship using the = relational operator, and summarize the related records.

Posted

This does look like what I have been looking for.

Does it matter what type of field I use for the self-join relationship (Global, etc.)?

Thanks,

Bill

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