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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Specialist
Specialist

Use colors from variables ?

Hello,

I have an Inline data set and I would like it to host a different color for each value.

Load * Inline

[_kpi_curves, _kpi_description, _kpi_color, _kpi_color_value

price, My price, vColPrice, "RGB(180,10,250)"

cost, My cost, vColCost, "RGB(80,10,250)"

mytest, My test, vColTest, "RGB(180,110,250)"

]

What i want to do is a Chart Straight Table with Background Text of each line of the color in kpi_color_value.

I have tried to put _kpi_color_value in the Background Color but it doesn't work.

Second thing I would love to do : instead of using _kpi_color_value, I would prefer using _kpi_color which is the name of the variable containing _kpi_color_value .. How can I use a variable from the name of a variable in such a table ?

Thanks

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Frederic,

Try this:

Load * Inline

[_kpi_curves, _kpi_description, _kpi_color, _kpi_color_value_r, _kpi_color_value_g, _kpi_color_value_b

price, My price, vColPrice, 180, 10, 250

cost, My cost, vColCost, 80, 10, 250

mytest, My test, vColTest, 180, 110, 250

]

Colour function:

RGB(Max({1<_kpi_curves={'price'}>} _kpi_color_value_r),Max({1<_kpi_curves={'price'}>} _kpi_color_value_g),Max({1<_kpi_curves={'price'}>} _kpi_color_value_b))

Kind regards

View solution in original post

4 Replies
vikasmahajan
MVP
MVP

Refer this .

V/ikas

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.
Anonymous
Not applicable

Hi Frederic,

Try this:

Load * Inline

[_kpi_curves, _kpi_description, _kpi_color, _kpi_color_value_r, _kpi_color_value_g, _kpi_color_value_b

price, My price, vColPrice, 180, 10, 250

cost, My cost, vColCost, 80, 10, 250

mytest, My test, vColTest, 180, 110, 250

]

Colour function:

RGB(Max({1<_kpi_curves={'price'}>} _kpi_color_value_r),Max({1<_kpi_curves={'price'}>} _kpi_color_value_g),Max({1<_kpi_curves={'price'}>} _kpi_color_value_b))

Kind regards

fredericvillemi
Specialist
Specialist
Author

Hello,

thanks for the example but I don't see the usage of the color in a straight table.

Does it work using only the variable name in Background Color ?

fredericvillemi
Specialist
Specialist
Author

Thanks, that's interesting

Instead of using the RGB function, I will use the 3 colors and keep the RGB function in the background color formula.