Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
niha
Creator II
Creator II

If else basing on color in Treemap of Qliksense

Hi,

I have developed a Treemap where Region and Task name are dimension . Measure is hours (MSL hours) . Top 20 task has to be seen .Untitled.png

The measures code :(sum({<FM ={'MSL'}>}Q1hours)+sum({< FM ={'MSL'}>}Q2hours)+sum({<FM ={'MSL'}>}Q3hours)+ sum({<FM ={'MSL'}>}Q4hours)

)

Task Dimension limits to top 20. 

The requirement is  if Task greater than or equal to 5 % of total hours are Gold color.

Untitled.png

I wrote a color condition like below but it is not 100 percent correct. please suggest. 

 

if(sum({<[Task Name]={'Travel'}>}Q1hours)>=5/100*sum({<FM ={'MSL'}>}Q1hours),RGB(231,187,73),rgb(144,144,144))

 

Thanks,

Niha

 

6 Replies
Kashyap_R
Partner - Specialist
Partner - Specialist

Hi 

try like this in color expression by changing the expression according to your dimension and measures

if(Aggr(Sum(Quantity),ProductName)>=(5/100)*Aggr(Sum(Quantity),CategoryName),Green(),Red())

I have attached the chart file please go through that it will give you correct insight what you are looking for.

Hope this helps 

Thanks

Thanks and Regards
Kashyap.R
niha
Creator II
Creator II
Author

Thanks. if  want top 2o Task, then for every task I have to write one expression, so for 20 task I have to write 20 expression , correct?

vikasmahajan

Hi 

Did you try this ?

https://community.qlik.com/t5/New-to-Qlik-Sense/How-to-use-colormix2-function/m-p/76529#M16148

vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
niha
Creator II
Creator II
Author

Hello,

Thanks. Not Yet as my requirements changed and I need to color code according to measure .

Thanks,

Niha

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Use color by expression and a color expression of:

If(Column(1) > 
(sum({<FM ={'MSL'}>}TOTAL Q1hours)+sum({< FM ={'MSL'}>}TOTAL Q2hours)+sum({<FM ={'MSL'}>}TOTAL Q3hours)+ sum({<FM ={'MSL'}>}TOTAL Q4hours) * .05
,rgb(231,187,73)
,rgb(144,144,144)
)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Prashant_Naik
Partner - Creator II
Partner - Creator II

Hi,

This might help

If(Column(1) / 
(sum({<FM ={'MSL'}>}TOTAL Q1hours)+sum({< FM ={'MSL'}>}TOTAL Q2hours)+sum({<FM ={'MSL'}>}TOTAL Q3hours)+ sum({<FM ={'MSL'}>}TOTAL Q4hours)) >'0.05',green(),red()
)

Regards,

Prashant