Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Not applicable
Author

It seems the expression in a TreeView does not behave the same as in charts.
I solved the problem of getting the recursive sum of all the subparts by adding a text Object with the same expression.

Since clicking on a contracted node of a treeView also selects all the sub nodes, the text object displays the total price of the part!

View solution in original post

1 Reply
Not applicable
Author

It seems the expression in a TreeView does not behave the same as in charts.
I solved the problem of getting the recursive sum of all the subparts by adding a text Object with the same expression.

Since clicking on a contracted node of a treeView also selects all the sub nodes, the text object displays the total price of the part!