Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Dynamic RGB Code

Hi everyone,

I want to create a dynamic Bacground color in a chart. I thought following would work:

RGB(Floor((1-(KAM/Max(All KAM)))*255),Floor((KAM/Max(All KAM))*255),0)

KAM is an integer.

I also checked, if the single expression work. They do. So I get RGB(0,255,0). But if I use it in the chart, I get an Error:

"Drawing of Chart failed internally"

Is what I am trying to do even possible, or do I have a mistake?

Best Regards

Max

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Well, I just did the file and it works there. I have the exact same field names and Expressions.

But I found the problem.

I had to define a color for the other Expression in the chart. I have no Idea why... But that fixed it.

Thanks.

View solution in original post

5 Replies
Highlighted
Champion
Champion

EDITED

Hi,

did you take a look at the values you get with this: (1-(KAM/Max(All KAM)))*255


maybe you go out of the range of 3 digits and exceed 255

Highlighted
Creator
Creator

No, sadly all values are between 0 and 255 and are floored, so no decimals.

Highlighted
Champion
Champion

would you be able to share sample app ?

you can try to put your expression into a variable

Highlighted
Creator
Creator

Well, I just did the file and it works there. I have the exact same field names and Expressions.

But I found the problem.

I had to define a color for the other Expression in the chart. I have no Idea why... But that fixed it.

Thanks.

View solution in original post

Highlighted
Champion
Champion

cool, problem resolved then