# Parent/Child Totaling

**URL:** <https://clarionhub.com/t/parent-child-totaling/8507>\
**Category:** questions\
**Tags:** browse\
**Created:** [August 20, 2025, 5:01pm UTC](https://clarionhub.com/t/parent-child-totaling/8507 "2025-08-20T17:01:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeutronBoy](https://clarionhub.com/user_avatar/clarionhub.com/neutronboy/32/4355_2.png) [@NeutronBoy](https://clarionhub.com/u/NeutronBoy)\
**Post date:** [August 20, 2025, 5:01pm UTC](https://clarionhub.com/t/parent-child-totaling/8507/1 "2025-08-20T17:01:55Z")

</div>

I have 2 browses in a window in a Parent/Child relationship. I can do totaling in the Child browse, but would like that total to be placed in a field in the Parent browse.

I am thinking that I could just PUT the totals in the Parent record manually, but am wondering if there is a template (CW 8 legacy) solution to this?

ty

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [August 20, 2025, 5:51pm UTC](https://clarionhub.com/t/parent-child-totaling/8507/2 "2025-08-20T17:51:46Z")

</div>

If you’re dealing with ISAM files, such as TPS, the easiest way is via an ALIAS table in the dictionary. Write a GetTotal(LONG pYourSysID,\*DECIMAL pOutTotal) procedure or something like that, using the alias so that it doesn’t mess with your child browse buffers.

---

<div class="post-metadata">

**Author:** ![JonW](https://clarionhub.com/user_avatar/clarionhub.com/jonw/32/1344_2.png) [@JonW](https://clarionhub.com/u/JonW)\
**Post date:** [August 21, 2025, 2:34pm UTC](https://clarionhub.com/t/parent-child-totaling/8507/3 "2025-08-21T14:34:49Z")

</div>

No template that I know of. Also, the normal “real” database approach would be just to have a view something like:

```auto
select par:id,par.<other columns>,c.total
from parent par
join (select parent_id,sum(c.value) total
from child 
group by parent_id) c on c.parent_id = par.parent_id

```

i.e. the total is always calculated on the fly, not stored in the parent record. Easy and quick in a database, slower if you are dealing with ISAM files.
