Jump to content
Server Maintenance This Week. ×

Calc if a Record is in the Found Set, without running a loop


Recommended Posts

Hi All!

Stumped on this one! Is there any calculation that would let me mark if a record is in the current found set?

So, if I've a database of say 100 files, I then perform a find for something, and that results in 30 records - is there any calculation that I can have so that those 30 records are marked, and the others aren't?

I've had a look through all the Get (x) and the other expressions, and I can't see one that would fit the bill. I could do it via a loop to mark the found records, but then I'd have to invert the selection, and clear that marker, which is more of a fuss than just being able to find if they're in the found set. It would get tricky if there were two windows open on the same records, with different windows having different found records, and so this might never have been made possible ... but wondering if there's a function for this?

Cheers

Link to comment
Share on other sites

Your question is not very clear. What would be the purpose of marking those records? After all, they are already "marked" by being in the found set.

Speaking in general, there are two ways to mark a record: permanently and temporarily. The permanent way is the one you mentioned: setting a "flag" field in the record itself. This necessitates modifying the actual record, and the resulting marker is in force for all users - so probably not suitable for marking records in a temporary found set of a particular user. Note also that this can fail if another user is editing a record that needs to be marked or cleared.

The other method would populate a global field or variable with a list of IDs of all the records that should be marked (for the current found set, you could do this by looping or by using a summary field) and a calculation that checks if the current record's ID is in the list. This would be good for the duration of the current session - but you could store the list in the user's record and recall it at their next login. 

 

Edited by comment
  • Like 1
Link to comment
Share on other sites

Thanks for your reply Comment.

Why I'd like to do it - I've got one Table with Companies, and one linked Table with People. I want to find records within the People table that have [x], and then I want to go to the Companies table and see how many [x] People there are per Company, so that I can then fix the issue, starting with the Companies that have the most number of [x] People.

My go to was the second method you stated, but I was just hoping that there was a Get(x) that would flag those People's records that were in the found (ie current) set. This is in a single user environment, so noted what you said about multiple users.

Much appreciated, thank you

Link to comment
Share on other sites

18 minutes ago, Slater said:

I was just hoping that there was a Get(x) that would flag those People's records that were in the found (ie current) set.

There isn't - and it would be of no use if there were. We know that all the records that we can see are in the current found set. And we cannot see the omitted records, so it doesn't matter if they are marked or not. And once you moved to a different found set, such function would then re-evaluate its results and again tell you nothing you don't know already. If you want to use the results of a find under a different found set, you need to take some note of the current found set - either permanently or temporarily.

 

27 minutes ago, Slater said:

I want to find records within the People table that have [x], and then I want to go to the Companies table and see how many [x] People there are per Company, so that I can then fix the issue, starting with the Companies that have the most number of [x] People.

If you wanted, you could do all this in a layout of People, with the same found set produced by the original find. You can sort the found records by CompanyID and reorder them based on a summary field that counts the records. Then view the company details in a sub-summary part.

 

Link to comment
Share on other sites

1 hour ago, comment said:

There isn't - and it would be of no use if there were.

 

Haha, yes, true!

Thanks for your help. I implemented a solution to it using a temporary marker in People that could be counted within one of my current Company layouts, so that I could then order the Companies appropriately. Appreciate your help :)

Link to comment
Share on other sites

On 1/31/2024 at 11:15 AM, Slater said:

I've had a look through all the Get (x) and the other expressions, and I can't see one that would fit the bill. I could do it via a loop to mark the found records, but then I'd have to invert the selection, and clear that marker, which is more of a fuss than just being able to find if they're in the found set. It would get tricky if there were two windows open on the same records, with different windows having different found records, and so this might never have been made possible ... but wondering if there's a function for this?

Is this an attempt to dwindle a.k.a. pointing at records not taken and used yet? 

If the structure is a many to many relation, which is made with a join-table, could following undocumented feature actually be utilised:

https://filemakerhacks.com/2015/02/02/summary-list-as-relational-predicate-part-2/

 

Skrmbillede2024-02-01kl_17_55_00.png.7e3fbb8c0d382fc7046bb24df9814a5e.png

...the graph, looks weirdly grayed out but if GTRR is by this much faster than GTRR(FS) to establish the remaining.

 

--sd

Link to comment
Share on other sites

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.