4 Replies Latest reply: Dec 3, 2015 1:31 PM by Enrique Colomer

# Sum

Hi all,

I have a visualization problem, I think.

I have 4 table:

1) Final Product

2) Bill of Material

3) Product

4) Cost

Each table include reference to his master (the number 1 is the major and number 4 is last child).

I need to have for each Final Product the cost represented as

Product.quantity * Cost.price

When I use a Qlick Table I can see the right result for each Product in BoM. But when I convert in Pivt Table, rows disappear, like it could not manage sum without explode ...

I hope you can help me (and also understand the problem!)

In attach the piece of DB view and the table showing rows correctly calculated ...

Messaggio modificato da Natale Zaramella BOM is the right example, but I find it difficult: I do not have an hierarchy... I attach an example with the two graph, the pable that shows results and the pivot that does not ... I can't understand why pivot is not showing results ...

• ###### Re: Sum

If you have problems with a BoM then perhaps this discussion helps: BOM Explosion using Hierarchy & HierarchyBelongsTo

Or this blog post: Bill of Materials

If those don't help please be more specific about your problem. If possible post a small qlikview document that illustrates the problem.

• ###### Re: Sum

BOM is the right example, but I find it difficult: I do not have an hierarchy...

I attach an example with the two graph, the pable that shows results and the pivot that does not ... I can't understand why pivot is not showing results ...

• ###### Re: Sum

You use the expression sum(Price)*Qty. You don't use an aggregation function to sum Qty. If you don't use explicitly use an aggregation function then Qlikview will use the Only() function. But the Only() function can only return a value (hence its name) if there is only one possible value. For each FinalProductID there are several possible Qty values, one for each ProductID. If you enable the Always Fully Expanded option then the ProductID dimension will also be shown and you'll get to see results. The other thing you can do is use this expression instead: sum(Price*Qty).