Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set RGB using Set Analysis

Hi guys,

I have a table where I have a dimension called Week and for each Week a Color. Now, in a graph I'm trying to apply that RGB for the Week status. I have done that in a chart where I can add the Week dimension hidden, so I don't have to use any Set Analysis, but in the graph I can't use that Week as dimension. So I was wondering if I can use Set Analysis inside an RGB.

Thanks!

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No, you can't use set analysis in the RGB function. If you have a table with colors per week in red, green and blue values you can put those into the RGB function

WeekColors:

load * inline [

WeekNo, R, G, B

1, 255, 0, 0

2, 255, 128,0

3, 255, 255, 0

...etc

];

If you have a table as above you can use WeekNo as dimension and an expression like RGB( R, G, B) for the color expression for dimensions and expression colors.

If you need more help please post an example file that explains what you want.


talk is cheap, supply exceeds demand
Andrea_Ghirardello

why don't you use the background color parameter of your expressions? You do not need to add the week field in your chart.

E.g.

=if(Week <20, rgb(100,100,100), rgb(200,200,200))

Anonymous
Not applicable
Author

That's what I'm doing. But I have a Combo Chart with 3 expressions (2 bars and 1 line) and 1 dimension if I add the WeekNo dimension the bars get stacked and the line loses the axis properites.

rbecher
MVP
MVP

I guess it's possible to use set analysis to give back an RGB() string which can be used with $-expansion. But to show how this could work I would need a sample app..

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine