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.

Distinct count in sub-summary

Featured Replies

(I know this has been covered multiple times here but after after performing multiple searches I can't find the answer, so my apologies for subject repetition.)

Happy holiday season, all.

This is pretty basic but I'm blowing it calculation-wise: I have a report that has two, summarized sections, the first by Test Code (TestCode__lxn, a number field) and the second by name (Name_LF__lct, a calculated concatenation of the Name_First__lxt and Name_Last__lxt text fields.)

What I want is a (distinct) count of students per test code (FieldName: Count) in the summarized Test Code section.

I first tried Name_LF__lxs--a summary field set to count Name_LF__lct--but with it parked in the Test Code summary section I get a count, but not a distinct one, i.e., it shows 40 instead of 37 because it's counting multiple, same-named Name__LF__lct records (3 of them).

Next, I tried GetSummary ( Name_LF__lxs ; Name_LF__lct ), but it shows only a count of 1.

...then I tried making a value list out of Name_LF__lct and used the calculation, ValueCount ( UniqueValues ( Name_LF__lct ) ) ...with indexing turned on since it's a calculated field. No good--still shows a count of 1.

I'm sure I could whip up an E-SQL calc but I'd prefer to keep to native FMP commands. I'm sure the answer's simple...too simple for this overcomplicated brain to handle. TIA for your help!

Actually, it's not that simple - and it used to be even more complicated

Start by defining a summary field as List of Name_LF__lct. Then add a calculation field (result is Number) =

ValueCount ( UniqueValues ( GetSummary ( sListOfNames ; TestCode__lxn ) ) )

where sListOfNames is the new summary field.

Add the calculation field to the sub-summary by TestCode__lxn part.

  • Author

Rats, still getting a "1" for a count. I included a screenshot for your review of Count__lcn and Name_LF__lxs.

Here's the calc, as entered, in the Count__lcn field: 

ValueCount ( UniqueValues ( GetSummary ( Name_LF__lxs ; TestCode__lxn ) ) )

 

 

Screen Shot 2018-12-03 at 10.44.37 AM.png

Screen Shot 2018-12-03 at 10.48.35 AM.png

The summary field you show is defined as Count of, instead of List of.

  • Author

*blush* I had already defined the new Summary field but forgot to connect to it. Works like a charm--MANY thanks!

Create an account or sign in to comment

Important Information

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

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.