Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
shoaibmulla
Contributor
Contributor

Custom Color by Dimension in Tree Map

Hi 

I am new to Qlik sense, I have a simple question

Chart Type: Treemap

Dimension:

 =IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>28,
'Delayed > 4 weeks',
IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>7,
'Delayed between 1 and 4 weeks',
IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>-7,
'Projects Delivered On Time',
'Projects Delivered Early'
)
)
)
 

Measure:

= SUM(
IF(
MATCH([Server.Stage],'Start Up', 'Delivery','Closed','Delivery-Closure', 'DLP','Support')
AND MATCH([Server.Portfolio], 'Domestic Precinct','International Precinct','Landside Infrastructure' ,'CAD & Spatial Services', 'Aeronautical', 'Commercial','Major Projects'),
[POIMS_Finance.Forecast Final Cost]))

 

I am trying to use the same dimension expression for Color by Expression, however, does not seem to work.

=IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>28,
'#D5331E',
IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>7,
'#FF9900',
IF(
Date([Timeline_Forecasts.Forecast Practical Completion]) - Date([Timeline_Forecasts.Baseline PC Date])>-7,
'#71B238',
'#4885ed'
)
)
)

The color expression does not work and last color (through else expression is chosen. Would appreciate support.

Thanks

Shoaib

4 Replies
Anonymous
Not applicable

Try if condition in script , also if you can define color in script itself and can use that field in color expression

Ralf-Narfeldt
Employee
Employee

As the expressions are the same, can't you just use Color by dimension?

shoaibmulla
Contributor
Contributor
Author

Thanks. However, I cannot change the load script. Hence, I am trying out my options with the front end.

shoaibmulla
Contributor
Contributor
Author

I have tried color by dimension as well. However I am not able to use custom colors. Would appreciate your help.