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: 
yufei
Contributor
Contributor

how to set color by expression based on multiple condition, if( measure = 'startdate', white(), if[Projects Priority] = 'Strategic',red(),green())

Hello Qlik community,

I am making a gantt chart using a stack bar chart, dimension is 'project', stacked with measure 'startdate' and 'duration', i want to set 'startdate' always white, and set 'duration' 's color depend on this project'priority', there are two types of priority, strategic and non strategic, i want to set red color for strategic for duration, and green color for non strategic, how to do this in Qlik's stack bar chart by color expression like above? i mean the formula

 

I thought the formula may be like 

if( measure = 'startdate', white(), if[Projects Priority] = 'Strategic',red(),green())

but it does not work, has error

This is my gantt chart now, i want it to have 2 colors, red for strategic project and green for non-strategic project

yufei_0-1689525778025.png

 

Thanks in advance!

 

Labels (4)
1 Reply
anychart
Partner - Specialist
Partner - Specialist

This Qlik's guide can be helpful: https://community.qlik.com/t5/Qlik-Sense-Documents/Qlik-Sense-Color-Range-Theme-Approach/ta-p/149102...

You are also more than welcome to try our flexible Gantt chart extension https://qlik.anychart.com/extensions/anygantt/docs/project. Here's how to set colors based on multiple conditions using expressions, for example: https://qlik.anychart.com/extensions/anygantt/docs/project/#color-by-expression

Feel free to download and check out our demo apps (view live or download QVF).

qlik gantt.gif