Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cfountain72
Creator II
Creator II

Distribution Plot Color

Hello,

I created a Distribution Plot, and want to see how to make the dot colors change based on whether its value is above or below the average for that dimension. I tried this, but it didn't work as expected...

=if(DurationMinutes > (Avg({<EventCategory={'Surgical'}>}DurationMinutes)), red(), blue())

Any suggestions?

Thanks in advance,

Chris

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, not sure to understand what you want to compare, the TOTAL option might work, if you want to add additional segmentatation you can use: Avg(TOTAL <DimensionField> ...

View solution in original post

3 Replies
rubenmarin

Hi, it will be better if you have a variable with that expression, so it's calculated for the whole selections, and ignoring the dimension.

Create a variable vDuratonMinutes with value: =Avg({<EventCategory={'Surgical'}>}DurationMinutes) 

Then you can use this variable:=if(DurationMinutes > $(vDuratonMinutes), red(), blue())

Another way can be using TOTAL qualifier to ignore dimensions:

=if(DurationMinutes > (Avg(TOTAL {<EventCategory={'Surgical'}>}DurationMinutes)), red(), blue())

 

cfountain72
Creator II
Creator II
Author

Thanks for your helpful reply Rubenmarin.

But actually, we need the colors to be conditional based on each dimension's avg value. This is because we don't want to compare the values vs the full dataset's avg, but vs others within the same dimension. Hope that makes sense.

Thanks,

Chris

rubenmarin

Hi, not sure to understand what you want to compare, the TOTAL option might work, if you want to add additional segmentatation you can use: Avg(TOTAL <DimensionField> ...