Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Best use of variables in expressions

Which is the best and most efficient approach to using a variable to control colors using the RGB() function:

1) =$(vBlack)

where vBlack = RGB(0,0,0)

or

2) =RGB(vCaptionBgRed, vCaptionBgGreen, vCaptionBgBlue)

where the RGB values are individual variables.

2 Replies
Not applicable
Author

I think first way is easy to maintain. You just have to change the values for one variable.

Thanks

Not applicable
Author

I've had good luck with using color variables named for their purpose (like vColorChart01, or vColorCaptionActive), and then loading them from an Excel file.

This way, you have easy universal control over your colors, in better context.

Oh, and store them as RGB(xxx,xxx,xxx) values in the Excel file. You could also keep the values in separate columns and have Excel concatenate them into the second column (first is the label), as RGB(xxx,xxx,xxx).

-DJ