Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
andreas_koehler
Creator II
Creator II

How to colormix a scatterbox?

Hi,

The aim is to have a scatterbox where the color of the bubbles represent the progress in time, which is the dimension of the scatterbox.

I creates the colorcoding in a simple table (see attached example) with

=ColorMix1((TimeGroup-Min (Total TimeGroup))/ (

Max( Total TimeGroup)-Min (Total TimeGroup)), lightgray(), blue())

but I wonder where to add this expression or which other way there is to define the color based on the value of the dimension. I did put it into the expression of the background color of field 2 but it did not work.

I attached an example with a scatterplot and a simple table and the result I would like to achieve is getting bubbles the same color as the background of the simple table.I want this color code just for this single diagram and there can be quite a lot of bubbles.

Any help is greatly appreciated.

Andreas

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like attached?

View solution in original post

5 Replies
swuehl
MVP
MVP

Maybe like attached?

andreas_koehler
Creator II
Creator II
Author

Stefan,

Lightning-fast and exactly what I wanted.

Thanks!

Why did my version work with the straight table but not with the scatterbox?

swuehl
MVP
MVP

I changed to things:

- Put the background color expression into the first expression (X)

[I think this was the change that made it work]

- I've used Getcurrentfield() to retrieve the current dimension from the dimension group, so the coloring works also when changing dimension

andreas_koehler
Creator II
Creator II
Author

Thanks Stefan,

I digged more into your solution and wondered why it does not work with a date format like

'W' & Week([Date]) & '-' & Year([Date]) as TotalWeeks?

My first thought was that this is because Week() has not the granularity to determine a value but then WeekStart() should work what it does not.

! attached a new version of the example with the change in the TimeGroup.

Best

Andreas

swuehl
MVP
MVP

This TotalWeeks calculation returns a text and the colormix() function needs numbers to calculate the numeric value for the color mapping.

Something like

Dual('W' & Week([Date])& '-' &Year([Date]), Weekstart(Date))    as TotalWeeks