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

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

16 Replies
sinanozdemir
Specialist III
Specialist III

Then I think you want to do it like this:

If([DESC:Stage] = '5_Final Proposal Submitted', RGB(255,255,255),RGB(0,0,0))

If this doesn't work, can you post a small sample dataset?

Thanks

Not applicable
Author

Yes that worked! Why would you put a square bracket here and what is the second RGB for?

Thanks so much Sinan

sinanozdemir
Specialist III
Specialist III

Because when dimension and measure names are funky like this one, (it has special characters or spaces), then you need to enclose them with square brackets.

The second RGB is for if the first condition is not met so if the dimension is not '5_Final Proposal Submitted', then it gives another color. In your case, when dimensions don't have '5_Final Proposal Submitted', then they will be black - RGB(0,0,0) is for color black.

Makes sense?

Not applicable
Author

If I were to put it multiple if functions, are there any additional things to add? For these below:

if([DESC:Stage]='4_Negotiation/Review',RGB(220,20,60),RGB(0,0,0))

if([DESC:Stage]='3_Proposal/Price Quote',RGB(205,205,0),RGB(0,0,0))

if([DESC:Stage]='2_Formal Presentation',RGB(192,255,62),RGB(0,0,0))

if([DESC:Stage]='1_Identified Opportunity',RGB(135,206,250),RGB(0,0,0))

sinanozdemir
Specialist III
Specialist III

Then you will need to nest them like the below:

if([DESC:Stage]='4_Negotiation/Review',RGB(220,20,60),

     if([DESC:Stage]='3_Proposal/Price Quote',RGB(205,205,0),

          if([DESC:Stage]='2_Formal Presentation',RGB(192,255,62),

               if([DESC:Stage]='1_Identified Opportunity',RGB(135,206,250),RGB(0,0,0)))))

You can send me a sample dataset and I can try to come up with a solution for the sorting part as well if you would like.

Not applicable
Author

Got it! Thanks so much

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.