Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Null values in Pivot Table causing issues with Calculations

Hi

I am having an issue with Null values in a pivot table that are affecting my calculations specifically because I need to hide them from the dimension. They cannot be showing in the front end view.

First let me explain what we have done here. In the database there is a hierarchy of Chains but because the users want to see different levels of Chains in the same dimension we have created a dimension that pulls in the specific ones they want to see from different dimensions. So what happens is that everything that doesn't fall into the ones we are wanting to see in our created dimension will show as a Null value which is why the Null values cannot be shown in the charts.

The calculation itself is not very complicated:

sum(Spend)/sum(total <Chain> Spend)

In this first table example the Null values are being included in the table and the calculations are giving me the correct percentages:

  

ChainCategory
Chain 119.8%
Chain 1.110.3%
Chain 1.211.0%
Chain 20.4%
Chain 314.6%
Chain 43.3%
Chain 52.8%
Chain 60.4%
-100.0%

But if I hide the Null values then I am getting these percentages (which are obviously only calculated from the Chains that are showing):

  

ChainCategory
Chain 131.9%
Chain 1.116.5%
Chain 1.217.7%
Chain 20.6%
Chain 323.4%
Chain 45.3%
Chain 54.6%
Chain 60.6%

I have tried a number of different things to try and get it to work as I need it to work but so far no luck so any suggestions that you might have would be appreciated.

Please don't ask me to post a sample of the data as I have posted what I can. This is obviously a much simpler version of what I am doing as both the Chain and the Category dimension are ones that we have created as I explained at the top.

Thanks

Colleen

3 Replies
Not applicable
Author

Sorry the calculation should be as follows:

sum(Spend)/sum(total <Category> Spend)


Otherwise it doesn't make much sense

Gysbert_Wassenaar

Try this expression: sum(Spend)/sum({<Chain=>} total <Category> Spend)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Does this suppress null values under dimension tab not work?