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

ColorMix1 with hex color?

Is it possible?  Something like this:

ColorMix1($(some_variable), white(), '#4477aa')

I don't know what the correct syntax is, but the above does not work.

4 Replies
petter
Partner - Champion III
Partner - Champion III

You can do this:

ColorMix1( $(some_variable) , white() , Num#( '4477aa' , '(HEX)' )  )

mmarchese
Creator II
Creator II
Author

That sort of works, but the result looks glitched out as shown in the screenshot below.

The left column's background color formula is:

ColorMix1(Expression3, white() , rgb(68, 119, 170))

The right's color formula is:

ColorMix1(Expression3, white() , Num#('4477aa', '(HEX)'))

ScreenClip [3].png

Kaushik2020
Creator III
Creator III

does this really work with a treemap ? i am using a treemap where i am using something like below for the Color by Expression property. 

ColorMix1(Sum(ProjectsCount), white() , Num#('008FB8', '(HEX)'))

marcus_sommer

Not all objects support all features. Therefore apply fixed values within a dummy to test the functionality - something like: colormix1(0.5, white(), red())

If this is working make sure that the expression returns always a valid result, for example with something:

alt(rangemax(0, rangemin(1, MyExpression)), 0.5)

A single invalid result or NULL may result in a strange behaviour or that the entire logic is skipped.

Beside the above may the num#() beeing wrapped with a num(). Helpful may also to put the hex-code and/or the rgb() and/or the auto-color like lightblue() with a wrapping num() in a table - because all should be resolved to a number().