Jump to content
Server Maintenance This Week. ×

Distinct count in sub-summary


This topic is 1970 days old. Please don't post here. Open a new topic instead.

Recommended Posts

(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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 1970 days old. Please don't post here. Open a new topic instead.

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.