Creating a tally list in a parent database

Discussions for the HanDBase for iPad and it's conduits and desktop add-ons

Creating a tally list in a parent database

Postby chuxtable » Sun Nov 09, 2014 5:49 pm

Hi, I was wondering if it is possible to set up a tally in a parent database of the number of records in different categories in a child database. The problem is this: I have a parent database which contains details for a single field site, ie. Site name, date, recorder and GPS location. A link to a child database allows you to jump to another form to enter multiple plant species for that particular site. This child database contains fields for site name (linked to parent database), plant species name, species rating and species cover score. Now, what I would also like to have in the parent database is a tally list showing how many records in the child database occur for each species rating. I would like that this tally would be auto-calculated every time a new plant species record for the same site was added in the child database. For example,I create a new record in the parent database for "Site 1". I then want to add plant species found at Site 1, so I tap the link to the child database. I then enter 6 species along with their rating and cover score (6 records for Site1 in the child database). Suppose that of the 6 species, 2 have a rating of "1", 2 have a rating of "2" and 2 have a rating of "3". When I have finished entering species for Site 1, I close the child database and return to the parent database, which shows the unique details for site 1. I would like those details for Site 1 to include a tally showing "Species with rating 1: 2; Species with rating 2: 2; Species with rating 3: 2". I would then want to do the same for Site 2, etc.
I imagine this is possible by using relationships, links, conditional and calculated fields, or some combination of these?!, but my head is getting scrambled. Can anyone help?
chuxtable
 
Posts: 67
Joined: Tue Mar 27, 2012 10:16 pm

Re: Creating a tally list in a parent database

Postby Brian_Houghton » Mon Nov 10, 2014 6:32 am

Hi,

Thanks for posting.

Within the child database you will want to use a calculated field to count the records. To do this, configure the calculation to add 1 to the previous value of this calculated field.

Then in the parent database add a relationship field that shows the last value of this calculated field.

Hope this helps.
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Creating a tally list in a parent database

Postby chuxtable » Mon Nov 10, 2014 5:47 pm

Hi David, unfortunately your suggestion did not work. A question I have is, do relationships work in 2 directions? Ie. In the parent database, I have a "Link" field (called "NewSpecies") which connects to a "Linked" field in the child database (called "Site"). The field in the child database that I want to show back in the parent database is a calculatedfield called "Tally1". I then created a relationship field in the parent database called "Tally1", which I want autopopulated with the value from "Tally1" in the child database. The settings I have for this relationship field are: "Related field in this database: NewSpecies"; "Other database name: SpeciesForm" (name of the child database); "Field in other database: Tally1"; "show from other database: Tally1"; and "From which record: Last matching record". This doesn't work. My question is, can you have a relationship field related to a "linked" field, or does it have to be related to a "Link" field? Any help gratefully received! Charles
chuxtable
 
Posts: 67
Joined: Tue Mar 27, 2012 10:16 pm

Re: Creating a tally list in a parent database

Postby dhaupert » Mon Nov 10, 2014 8:46 pm

Hi,

I didn't write the previous post- that was Brian! What he said is correct though- I use this exact method to get the totals for calories and macros in my nutrition databases and it works great. What you need to do is use the link/linked pair as the ones your relationship field points to. That is, the 'Related Field in this database' must point to the link field, and the 'Field in other database must point to the linked field in that database. Then grab the running total value and you'll get a running total for the related records only!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Creating a tally list in a parent database

Postby chuxtable » Mon Nov 10, 2014 10:22 pm

Thanks Dave, sorry for getting the names mixed up - that worked a treat, problem solved. Thanks also Brian
chuxtable
 
Posts: 67
Joined: Tue Mar 27, 2012 10:16 pm


Return to HanDBase for iPad

Who is online

Users browsing this forum: No registered users and 1 guest

cron