![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FMP 10 Adv: I have 20'000 records with some 15'000 parents - what's the best way to count the number of parents of my present found set in the child table? The count function returns 1 for every single record, the sum will be the number of child records, i.e. the number of records in my found set. |
#3
| |||
| |||
|
|
FMP 10 Adv: I have 20'000 records with some 15'000 parents - what's the best way to count the number of parents of my present found set in the child table? The count function returns 1 for every single record, the sum will be the number of child records, i.e. the number of records in my found set. |
)
#4
| |||
| |||
|
|
FMP 10 Adv: I have 20'000 records with some 15'000 parents - what's the best way to count the number of parents of my present found set in the child table? The count function returns 1 for every single record, the sum will be the number of child records, i.e. the number of records in my found set. |
arent_id to Parent:
arent_id
#5
| |||
| |||
|
|
I'd use Go To Related Records, select the Match Found Set option, then use Get(FoundCount) to set the value into a variable, after the GTRR. Then return to the original child record set. |
#6
| |||
| |||
|
|
e.g. rel_SameParent match record in ChildTable with records in ChildTable when ParentKey = ChildTable::ParentKey |
|
Another way would be to create some fields in the Parent Table. Create a Calculation Field to "flag" if there are any related Child Table records. e.g. HasChildRecords Calculation, Number Result, Unstored = If(Count(rel-ChildTable::KeyField) > 0; 1; 0) |
#7
| |||
| |||
|
|
Lynn Allen<lynn (AT) NOT-semiotics (DOT) com> wrote: I'd use Go To Related Records, select the Match Found Set option, then use Get(FoundCount) to set the value into a variable, after the GTRR. Then return to the original child record set. Thanks - I thought as much. I take it there's no way to calculate the number then. |
#8
| |||
| |||
|
|
But another way would be to use the List() function to get all ParentID's from the child table. Then use a valuecount() of UniqueValues() to determine the number of unique parent IDs. |
#9
| |||
| |||
|
|
Lynn Allen <lynn (AT) NOT-semiotics (DOT) com> wrote: I'd use Go To Related Records, select the Match Found Set option, then use Get(FoundCount) to set the value into a variable, after the GTRR. Then return to the original child record set. Thanks - I thought as much. I take it there's no way to calculate the number then. |
#10
| |||
| |||
|
|
Create a Relationship in the child table to group the related records. e.g. rel_SameParent match record in ChildTable with records in ChildTable when ParentKey = ChildTable::ParentKey Then you can create a Calculation Field which works out each record being 1/xth of the total number of same parent records. e.g. OneXth Calculation, Number Result, Unstored = 1 / Count(rel_SameParent::ParentKey) If you were to then create a Summary Field and Summary Report totalling these values, you would get a total of 1 for each different ParentKey sub-summary. Which also means to get the number of unique parent records you can simply summarise them all e.g. s_NumParentRecords Summary Total of OneXth |
![]() |
| Thread Tools | |
| Display Modes | |
| |