Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How can I perform a find that returns only unique records?

Featured Replies

How can I perform a find that returns only unique records? This is a simple task in MySQL but I cannot find an easy way to do this in Filemaker.

For example, let say I poll 500 people and I ask them their favorite ice cream flavor. I want to perform a find in the ice cream flavor field and see a list of all of the flavors that were submitted...but I don't want to see 200 records for chocolate, 50 for vanilla, etc. I just want to see a found set that contains a single record for each flavor that was submitted.

I realize that I can generate a report, or a relationship list that displays the information but I want to do this with a standard find...without having to create a looping script. Is this possible?

see a list of all of the flavors that were submitted.

You could summarize the records by flavor and show them using a layout with only the sub-summary part (and no body part).

  • Author

You could summarize the records by flavor and show them using a layout with only the sub-summary part (and no body part).

I realize that I can generate a report, or a relationship list that displays the information but I want to do this with a standard find...without having to create a looping script. Is this possible?

I had a similar need the other day. I had several items in my database that have the same item number but a different version of a drop down.. blue, green, etc... So I only wanted it to count it once.

Reading the article below gave me the idea on how to figure it out. Unfortunately, I am not sure how you would do it without some kind of loop to check the flag.

You first must make sure you sort by the Field you are checking, otherwise this won't work. You can do this with any found set, or just show all records.

I then used the function GetNthRecord()

I created an unstored calculated field...

Let (

[RecNum = Get(RecordNumber)];

If(GetNthRecord ( Item #; RecNum) ≠ GetNthRecord ( Item #; RecNum - 1); 1;0)

)

http://www.filemakerhacks.com/?p=1798

From there you can basically run a loop that counts any record that has a "1" in the unique field calculation.

Hope that helps a little.

Thanks,

HALBURN, on 30 October 2011 - 02:50 AM, said:

I realize that I can generate a report, or a relationship list that displays the information but I want to do this with a standard find...without having to create a looping script. Is this possible?

I have read your post before replying to it.

Comment's suggestion of a summary report needs only a standard find and does not require a looping script.

Well, a 'standard find' (whatever that is) cannot create "a found set that contains a single record for each flavor" - at least not without defining a self-join relationship first. However, the suggested summary report will still show a single row for each flavor.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.