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: 
yoganantha321
Creator II
Creator II

RGB color in expression

Hi all,

I have a column name RGB codes  as shown below. But i need to pass the RGB value to background for the expressions. The RGB values may differ it cannot be calculated.

Output received using expression Color (RGB codes)


RGB codes    expression(color(RGB codes))

0,176,240        RGB(0,0,0)

255,255,255    RGB(0,0,0)


Expected output:


RGB codes    expression(color(RGB codes))

0,176,240        RGB(0,176,240)

255,255,255    RGB(255,255,255)


Anybody help me in this!

Regards,

Yoganantha Prakash G P

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

try like this:

RGB(subfield([RGB codes],',',1) ,subfield([RGB codes],',',2) ,subfield([RGB codes],',',3) ) as [RGB codes]

View solution in original post

5 Replies
manoj217
Creator III
Creator III

concatenate the string with the rgb codes you will get your expression

manoj217
Creator III
Creator III

your have a color codes field have a value like 255,255,255   now you want to convert like this right  RGB(255,255,255)

backend you can concatenate with this below code

'RGB (' & RGB codes    &')' as RGB codes New

yoganantha321
Creator II
Creator II
Author

but when i use the COLOR(RGB CODES) it is showing different color not showing the color RGB(0,176,240)

Frank_Hartmann
Master II
Master II

try like this:

RGB(subfield([RGB codes],',',1) ,subfield([RGB codes],',',2) ,subfield([RGB codes],',',3) ) as [RGB codes]

Anil_Babu_Samineni

Are you taking this expression as Expression? Or BG Color. It should be Background color of your expression? Can you show image how this written? Should work, If that is for BG color / If you sure, Please share sample application which is not working?

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