Dynamic background color for dimension in pivot table with horizontal dimension?
we have a strange problem:
There is a pivot table for which we want to define dynamic background colors for one of the dimensions depending of a calculation.
It works fine when all dimensions of the pivot table are just next to each other, going vertical.
But when we move the last dimension to go horizontal (to the right), it doesn't work properly. as soon as there is a missing value (e.g. because for a line there is no value in one of the dimensions which goes to the right) the expression for the color doesn't deliver any result.
For a better understanding i attached an example:
In the first object everything is fine.
In the second and third object the cell for Dim1 = B and Dim1 = C are not colored as they should. This happens because in these lines Dim2 starts with missing values (a and b show the -, so missing).
In the third chart the cells for B and C are gray, so the expressions seems to deliver NULL.
Do you know any trick how to surround or ignore the missing values and achieve the same coloring as in the very first chart?
a little correction: i wrote that in the third chart the expressions seems to deliver NULL because the cell is gray... but I misread my expression... actually it is gray because it doesn't deliver anything at all.... null would be yellow, not gray.
The expression defining the color is an attribute expression, and it will only be calculated if the main expression is calculated. Coloring will not be applied if the first column result is missing or null values. This is a limitation in QlikView. If you can use a Straight Table instead of a Pivot Table you shouldn't experience the problem. If you must use a Pivot Table you can add subtotals on top to as a workaround.
thanks for your answer. unfortunately it needs to be a pivot table and since the cells itself need to be colored the use of subtotals wouldn't help. or do you think there is a chance to solve this by subtotals? could you perhaps modify my example in that way?
The use of the subtotals solves the problem in the sense that now the cells are colored, but you will need to adjust the expression calculating the colors (since you are getting the wrong color sometimes). Look at your document modified that I have attached