Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table Totals not always displayed

I have a pivot table as below which is only showing a small extract of the data. The problem I have is that unless I really filter in on the data the total for Value Added is not displayed.

product fin_year Value GBPValue Added
MBEU17909099347328
MBEU17918987537861
MBEU17944442243401
MBEU179445-123901991
MBEU179602-135993061
MBEU17967232232606
MBEU18514315701414
MBEU2004401835114652
MBEU20054367165134
MBEU20511111491149
MBEU20511844604460
MBEU21510310981098
Total65466


If I select each product in turn then the total is displayed

product fin_year Value GBPValue Added
MBEU17967232232606
Total32232606


Any ideas what is causing this, the Value GBP field is setup in the same was but always returns a value

5 Replies
Not applicable
Author

How is the expression?

often the expression not shows the total amounts, because not sum to the dimensions, for example,when doing sums in if statements
regards

spividori
Specialist
Specialist

Hi!

You should use the function aggr.

Regards.

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I suspect you might have a part of your expression that can't be uniquely calculated at a total level, in which case you should either enclose all of your components within your aggregation function, or use aggr() to calculate the expression at a lower level of detail and then aggregate those pre-calculated results.

If you show your expression, it would be easier to pin-point the problem

Not applicable
Author

My expression as it stands is

Sum(order_book_value)-(standard_material*sum(sales_order_qty))

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Exactly what I suspected... your field standard_material may return multiple possible values at the total level, and that renders the whole expression as a null. I'd recommend 2 changes:

1. Include standard_material within the sum()

2. Use function RANGESUM, to avoid getting null() when one of the two sum() returns a null() or missing.

The end result should look like this:

RANGESUM( Sum(order_book_value), -1 * sum(standard_material*sales_order_qty))

I believe this should work.