Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys.
I have an issue with product tree hierarchy.
(Important: my customer has QlikView version 8.2, and therefore the hierarchy and hierarchybelongsto cannot be a part of the solution because it is not supported yet in this version)
I have a tree table of products and components, in which some products can be components of other products:
Product Component Date
X 111 ...
X 222 ...
Y 333 ...
Y X ...
Z 444 ...
Z Y ...
Z X ...
Another table is the cost price of the leaves (components that never appear as products):
Component Price
111 1$
222 2$
333 3$
444 4$
Now I have to sum up the cost of the leaves, then the cost of the products.
X = 111+222=3$
Y=X+333=3$+3$=6$
Z=Y+X+444=6$+3$+4$=13$
How can I do it (without using hierarchy fucntion)? As you can see in the example, X must be calculated before Y, and the Y (and X) before Z.
(P.S. I have to add later some operations to each product and pay attention to last cost price date, but I can manage that)
Thanks in advance!!
Montal.
Hi
I have attached one hierarchy example without using hierarchy function.
cahck it.
Regards
Kaushal Mehta
Hi,
Check it below example
Hi Kaushal.
I'm familiar with this example, but it's not helping me because I have a complicated parent-child situation here... Thanks anyway!
Any other suggestions? Is the only option through SQL and not through QV script?
have any one of you created tree hierarchies before QV 9.0?
Montal,
The only way I can see getting the correct results is to add X and Y as components in the price table.
Hope that helps.
Thanks.
The problem is how to know that X should be calculated before Y (and added to the costing table)..?
Here is another way of explaining the solution. You would add X and Y to the component table as shown below.
Product Component Date
X 111 ...
X 222 ...
Y 333 ...
Y X ...
Z 444 ...
Z Y ...
Z X ...
Another table is the cost price of the leaves (components that never appear as products):
Component Price
111 1$
222 2$
333 3$
444 4$
X 111 + 222 = 3$ (this can be a calculation or static value)
Y 333 + X = 6$ (this can be a calculation or static value)
Now when you join the Product table with the Component table the calculation or values will be correct.