Hello,

My scenario: I have a table "Inspections" with a child-table (1:n) "InspectionQuestions". For 1 "Inspection" there can be a lot of "Questions", and a question can have 1 "Type" of A, B or C. In the table "Inspections", I need 3 calculated fields ("CountQuestionTypeA", "CountQuestionTypeB" und "CountQuestionTypeC") which shows the count of records for each question-type in the child table. I now tried a lot of formulas, but I didn't get the right result. For example, for Type A, I tried this:

Sum ( If ( Length ( Inspections::FText ) > 0 AND Inspections::Type = "A" ; 1 ; 0 ) )

This delivers the famous "?" ;-(

What's the correct way to calculate the number of records grouped by a field-value?

Thanks for your help! Hans

You didn't give your calculation a field to sum.

If (Not IsEmpty(Inspections::FText) and Inspections::Type="A";Sum(keyField))

See link Sum Sum(field)