yamu

counting group of records in child-table

Discussion created by yamu on Jun 22, 2016
Latest reply on Jun 22, 2016 by yamu

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

Outcomes