How to get the count of parent record in child table?

  • 0
  • 1
  • Question
  • Updated 10 months ago
  • In Progress
I create a summary report in a child table.  I'd like to have the total count for the parent record in the summary report too.   However, there's no intrinsic way to do this.  Any one has some suggestions? 
Photo of Hongkun liang

Hongkun liang

  • 172 Points 100 badge 2x thumb

Posted 10 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
If you edit the relationship, you can make a summary field for the count of the # of children.  Then look that up down to the child records. 

Include that field in your summary report, but use a function of Average rather than Total so as not to multiply duplicate the total and just count it once, hence an average of all the identical values. 
Photo of Hongkun liang

Hongkun liang

  • 172 Points 100 badge 2x thumb
Thanks for your quick reply. I think it is easy to explain as a simple example.
Parent A:  3 Children
Parent B:  2 Children
I'd like to have a summary report to show
Parent: Children
2            5

The count of children itself is easy to get from the summary table.  I need the count of parent in the summary table.
Thanks!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
OK, I'm starting to understand.  I think that the issue is that you need to count all the children but just the unique parents.

How about this for an idea.

Make a summary of the Minimum [Record ID#] of the child record.  Call it [Record ID# of 1st Child].

Look it up down to the children.

Then have a formula called [# unique Parents] 

IF([Record ID#] = [Record ID# of 1st Child],1,0)

Then summarize that field and each parent should only be counted once.
Photo of Hongkun liang

Hongkun liang

  • 172 Points 100 badge 2x thumb
Very smart and quick idea!   Only problem is the minimum function will not be able change dynamically according to the filter of my report.  In order to get it work, I have to create many fields of [Record ID# of 1st Child] in the Parent table for different filters. Then create the respective formula field in the Child Table.  Thanks!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,306 Points 50k badge 2x thumb
Yes I see that as a problem too.  I did not think about Dynamic Filters.
Photo of Hongkun liang

Hongkun liang

  • 172 Points 100 badge 2x thumb
Thanks a lot.  Temporarily I will create four summary fields to satisfy my filter purpose.  Hope QB will build this feature in the future because it is a very typical summary data.