Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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 ...

Thanks in advance

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 ...

1 Solution

Accepted Solutions
Gysbert_Wassenaar

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).


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

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.


talk is cheap, supply exceeds demand
Not applicable
Author

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 ...

Gysbert_Wassenaar

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).


talk is cheap, supply exceeds demand

View solution in original post

ecolomer
Master II
Master II

You need change your formulas

Is this?

Products.png