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 do I count unique values being viewed?

Featured Replies

Example:

A view has a list of items that have been ordered from a company. Each item is attached to an order with an order_id relating the items file to the orders file.

How would I count the number of orders BEING VIEWED? That is, I need a global count of something like sum(unique(order_id))

Am I making any sense?

Thanks for any help you beautiful people.

-wald

Give each record an auto entered, sequential, ascending, unique record ID (RecordID). Create the relationship:

SelfByOrderID with Order ID matching Order ID in the same file.

Create a field:

Flag (calculation, number) = (RecordID = Min(SelfbyOrderID::RecordID)

The sum of Flag is the number of unique order id's.

-bd

Not straightforward ...

I'd use a script looping thru records, setting a global field to the order ID of the record and increasing another global field each time a different order ID is encountered ....

or

Copy the orderIDs of the selected records into a global text field, creating a multi-line key, relate this global field to the orderID of Orders and use a calc

Count (ThisRelationship::OrderID)

why not do a search, and omit duplicates based on that field?

  • 2 weeks later...
  • Author

That doesn't work because the min function gives the min of all entries in the table, not the min of the found set which is what I need.

Any suggestions?

I really don't want to use a loop, because that would slow things down too much.

Thanks a bunch

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.