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

Assign individual colors to multiple lines in a chart

I have a line chart that has multiple lines. I need to assign each line a specific color. I have gone to "Custom: Colors & Legend" then chose "Expression" .  In Expression I wrote:


If(Sum([Sales Actuals])>'0', RGB(59, 147, 65)) ,

If (Sum([Cost Actuals])>'0', RGB(200, 17, 165)) ,

If (Sum([Sales Planned])>'0', RGB(156, 100, 105)) ,

If (Sum([Cost Planned])>'0', RGB(250, 15, 75)) ,

If (Sum([Total])>'0', RGB(24, 60, 200))

 

What is the correct syntax to assign each measure its own color? Or how can I assign each measure its own color?

 

Qlik Sense 

Labels (1)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

You are closing conditions immediately to the IF where as it required in the end, like

If(Sum([Sales Actuals])>'0', RGB(59, 147, 65), If (Sum([Cost Actuals])>'0', RGB(200, 17, 165),

If (Sum([Sales Planned])>'0', RGB(156, 100, 105), If (Sum([Cost Planned])>'0', RGB(250, 15, 75),

If (Sum([Total])>'0', RGB(24, 60, 200))))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni

You are closing conditions immediately to the IF where as it required in the end, like

If(Sum([Sales Actuals])>'0', RGB(59, 147, 65), If (Sum([Cost Actuals])>'0', RGB(200, 17, 165),

If (Sum([Sales Planned])>'0', RGB(156, 100, 105), If (Sum([Cost Planned])>'0', RGB(250, 15, 75),

If (Sum([Total])>'0', RGB(24, 60, 200))))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ffanary
Contributor
Contributor
Author

Thanks!!!! That worked.