Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color Treemap by Expression

Hello,

I have been working to develop a treemap visualization in Qlik Sense and have hit a bit of a snag.

I've created a drill-down dimension, consisting of (Function, Category, Subcategory, and Findings), that the chart is viewed over. The corresponding measure is Count([Findings]).

Findings are either good (positive) or bad (negative) and should be colored on a two-tone scale (I chose red and green) according to the value in a corresponding field (Impact, equal to either 0 or 1).

At one level up - at the subcategory view - and onwards, I would like the coloring to change to a 4-toned scale (1-4) which corresponds to a rating, another field.

Findings are not associated with a rating. There is no set pattern for which combinations of good and bad findings correspond to a particular rating.

Initially, I coded for the findings to be colored first, followed by the other dimensions in the drill-down. This simple solution worked in most cases, but, for example, due to the method (unknown to me) by which groupings inherit color, a "Sub Category" with all "Positive" findings was inheriting the green color of its children findings, overriding the blue "3" rating.

Now, I have created an expression that almost works: in the above cases (where only one 'type' of finding is associated with a particular subcategory), only the finding that appears first in the raw data is inheriting the color of the parent 'subcategory' while every other one is colored correctly.

I realize this is a some what long-winded request for what is ultimately a review of my logic / understanding of the BNF used in Qlik expressions, so thanks to the community in advance. I have attached my current expression to this chat.

0 Replies