Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Tree map color assignment and ordering

Hello everyone,

I am very new to qlik sense and all the coding stuffs are new to me. Hope someone can help me navigate around this!

I created a tree map for projects with two dimensions- month and stage, and measure - the amount of money. I want to group them by month and color by stage. I managed to do that but I want to 1) assign a specific color instead of using the pre-assigned color by qlik sense, 2) order the groups (months) chronologically; it's in random order now.

Could someone please help with this? I've been trying to read discussions but not sure where to put these expressions or  codes and what not....?

Thank you

1 Solution

Accepted Solutions
sinanozdemir
Specialist III
Specialist III

Hi Seona,

I found the below thread about treemap sorting. As I said before, treemap is measure driven and sorting is dependent of the measure.

Treemaps In Qlik Sense

If you think that I was able to answer your questions, please mark this discussion as complete by clicking one of the answers as "Correct Answer".

Thank you.

View solution in original post

16 Replies
sinanozdemir
Specialist III
Specialist III

Hi Seona,

On the right pane, in the appearance tab, there is an option for colors. You can change colors by dimensions or measure.

Just to make sure that "Colors" switch is off so that you can assign custom colors.

Capture.PNG

And in terms of ordering, you can use the Data tab to sort the order of the treemap:

Capture.PNG

Hope this helps.

Not applicable
Author

Hi Sinan -- thanks for the quick reply!

I have already used the appearance tab by switching off the custom color but I want to use specific colors. Using the example of yours above, for example, I want to change the 2015-01 color (currently skyblue) to red. How can I assign specific colors to specific item?

Also, in terms of ordering the months, I have already used the data tap and put the 'Month' tap on top of other dimensions but I want to have them ordered chronologically from January to December (from left to right). Would I have to make separate columns or .. sort by expression (which is the part that i'm the most confused about).

Thank you for your help!

sinanozdemir
Specialist III
Specialist III

Hi Seona,

I have tried to apply a function to change the colors of treemap and it didn't work so I am not quite sure if this is possible in QlikSense. Hopefully, someone from Qlik could answer this question.

The sorting part is related to the measure. I think that treemap is measure driven so I tried to sort it by date and it didn't sort chronologically:

Capture.PNG

I personally believe this is as a result of 2015-05 and 2015-06 having less values than other months.

Hopefully, someone else has another opinion on this one.

sinanozdemir
Specialist III
Specialist III

Hi Seona,

I just figured it out the color part of it.

In the colors tab, choose "By expression" and type your if statement, please see below:

Capture.PNG

Here is the expression that I used to change the colors of dimensions:

Capture.PNG

Thanks

Not applicable
Author

Hi Sinan!

The expression didn't work for me. Should I write something in the data load editor beforehand?

sinanozdemir
Specialist III
Specialist III

Would you mind sending me your expression?

Thanks

Not applicable
Author

Here is my expression.

if(DESC:Stage = '5_Final Proposal Submitted',RGB(255,255,255),RGB(0,0,0))

sinanozdemir
Specialist III
Specialist III

Can you change it to this

If(Stage = '5_Final Proposal Submitted', RGB(255,255,255),RGB(0,0,0))

I am not sure what "DESC:Stage" is? Is it the full dimension name?

Not applicable
Author

Yes, that's the full dimension name actually. haha