Rich Posted December 3, 2018 Posted December 3, 2018 (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!
comment Posted December 3, 2018 Posted December 3, 2018 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.
Rich Posted December 3, 2018 Author Posted December 3, 2018 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 ) ) )
comment Posted December 3, 2018 Posted December 3, 2018 The summary field you show is defined as Count of, instead of List of.
Rich Posted December 3, 2018 Author Posted December 3, 2018 *blush* I had already defined the new Summary field but forgot to connect to it. Works like a charm--MANY thanks!
Recommended Posts
This topic is 2200 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 accountSign in
Already have an account? Sign in here.
Sign In Now