1 Reply Latest reply: Jun 8, 2012 2:29 PM by nir_aero RSS

    How to use aggregation functions on a TreeView hierarchy

      Hi,

       

      My database has a table of parts that can be composed of other parts. They each have a Price field.

      The Part table also has a Parent_Part field to represent an adjacent nodes tables (The parts hierarchy).

      In the Load Script I use the hierarchy function to obtain the PathName of each Part

      I can then visualise the hierarchy in a TreeView ListBox. (which is awesome by the way)

       

      I tried to calulate the total cost of a Part (the sum of the cost of the sub parts) by adding the caculated expression : SUM(Price)

      but I only get the the cost of one part.

       

      How do you calculate the total cost of a Part?

       

      Thanks for your help

       

      -Nick