Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic opacity in ARGB() for table background color.

Hello --

I'm attempting to change the background color of a table chart depending on how poor the dimension is performing.  I calculate the opacity of the ARGB() function by simply multiplying the percent change by 1000.  So if the dimension is performing 6% under from the year before the ARGB call would look like this: ARGB(60, 255, 0, 0).  I've played around with the function to make sure ridiculous numbers don't break it so ARGB(255, 255, 0, 0) works as well as ARGB(400000, 255, 0, 0).

Anyhow, it doesn't seem that putting the value in a field translates to a number ARGB() can use.  My function:  =If(change_percent <= 0, ARGB(opacity, 255, 0, 0)) that is behind the 'Background Color' doesn't work.  I've tried typecasting using Num() but that doesn't help.  Any suggestions?

Attached is an example.

Thanks,

Hudnutt

1 Solution

Accepted Solutions
ThornOfCrowns
Specialist II
Specialist II

You need to have a positive value in the A of ARGB, so muliply your opacity by -1:

=If(change_percent <= 0, ARGB(opacity*-1, 255, 0, 0))

View solution in original post

4 Replies
antoniotiman
Master III
Master III

Hi Dave,

have You tried to use Wizard of ColorMix1 or ColorMix2 ?

Regards,

Antonio

Not applicable
Author

I don't even know of such a thing.  I'll look into it.

antoniotiman
Master III
Master III

In background color -> File -> Wizard.

ThornOfCrowns
Specialist II
Specialist II

You need to have a positive value in the A of ARGB, so muliply your opacity by -1:

=If(change_percent <= 0, ARGB(opacity*-1, 255, 0, 0))