Skip 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.

Getting Distinct ID's

Featured Replies

Love the DISTINCT function of the SQL but trying to figure out how to get the correct set of records.

In a normalized file

member ----< email

there could be one or more duplicate emails in that table.

suppose I am already on the FOUND set in Members, i want a unique list of email addresses - or rather its ID's - i want to go to the related email table keeping the first instance of an email and omitting subsequent duplicates.

I need to end up on the email table so it can export the desired unique found set, that relate to the FOUND set in members.

Savvy?

Thanks

Stephen

Stephen, you would first a script that you capture your IDs for the found set of members. ( or copy all technique, CF, calc, etc )

SEt Variable [ $$foundset; "" ]

Go to Record [ First ]

Loop

Set Variable [ $$foundset; List ( $$foundset; contact::ID ) ]

Go to Record [ Next; Exit after last ]

End Loop

Set Variable [ $$foundset; Substitute ( $$foundset; ¶; "," ) ]

Then you could use something like the following:

ExecuteSQL("SELECT MIN(ID) from email WHERE contactID IN( " & $$foundset & " ) GROUP BY emailaddress"; ""; ""; "" )

  • Author

that won't work because my ID is actually is using get ( UUID )

I think it should still work but if using UUID, since it is text, you would need to to slightly alter the loop script.

SEt Variable [ $$foundset; "" ]

Go to Record [ First ]

Loop

Set Variable [ $$foundset; List ( $$foundset; "'" & contact::ID&"'" ) ]

Go to Record [ Next; Exit after last ]

End Loop

Set Variable [ $$foundset; Substitute ( $$foundset; ¶; "," ) ]

Kevin Frank"s latest BLOG has a demo file that includes some custom functions which will produce a string that is properly formatted for use with the IN clause. This might solve your problem.

  • Author

Thanks Guys - this did work. I will review Kevin's CF to. however i know his has that iteration limit.

However I doubt i'd ever reach 10k iterations.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.