Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Skip the ticket, Chat with Qlik Support instead for instant assistance.
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change color by expression for a scatter plot bubbles?

I want to change the color of my scatter plot bubbles based on their fractile(based on sales). I am using the following pece of code in expression:

if ([Total Sale Quantity]<=Fractile(total [Total Sale Quantity],0.20), Red(),

if ([Total Sale Quantity]<=Fractile(total [Total Sale Quantity],0.40), Blue(),

if ([Total Sale Quantity]<=Fractile(total [Total Sale Quantity],0.60), Green(),

if ([Total Sale Quantity]<=Fractile(total [Total Sale Quantity],0.80), Yellow(),


But, it is giving me lightRed fr all the bubbles. Please guide me where I am going wrong.


Best Regards,

7 Replies

Condition seems ok, Can you make it in sample?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

Hi Rahul, the first part of the comparison is only sales, not the fractile, maybe you are looking for?:

if (Fractile([Total Sale Quantity],0.2)<=Fractile(total [Total Sale Quantity],0.20), Red(),

if (Fractile([Total Sale Quantity],0.40)<=Fractile(total [Total Sale Quantity],0.40), Blue(),

if (Fractile([Total Sale Quantity],0.60)<=Fractile(total [Total Sale Quantity],0.60), Green(),

if (Fractile([Total Sale Quantity],0.80)<=Fractile(total [Total Sale Quantity],0.80), Yellow(),


Or there is more than one value for total Sale and needs to be aggregated, ie:

if (Sum([Total Sale Quantity])<=Fractile(total [Total Sale Quantity],0.20), Red(),

if (Sum([Total Sale Quantity])<=Fractile(total [Total Sale Quantity],0.40), Blue(),

if (Sum([Total Sale Quantity])<=Fractile(total [Total Sale Quantity],0.60), Green(),

if (Sum([Total Sale Quantity])<=Fractile(total [Total Sale Quantity],0.80), Yellow(),


Not applicable

No, my aim is to color the bubbles based on the sales. If the sales are in the 20 percentile then red and so on.

Not applicable

Sorry, I did not understand your point.


But each dot has only one value for [Total Sale Quantity]? Ie, if there is a value for each month and you select only a year there will be 12 different values for each dot (one for each month) and you need to do some aggregation to return only one value for each dot.

You can copy the chart and transform it to a table, make different expressions with each part of the expression to check the values:


- The current dimensions of the bubble chart


- [Total Sale Quantity]

- Fractile(total [Total Sale Quantity],0.20)

- Fractile(total [Total Sale Quantity],0.40)

This table shows the values you expected?

Not applicable

No, actually the table is also not showing the correct values. It is also showing me the last condition.


It will be difficult to reach a solution without an image or a sample that can give a tip on how is your data model and what's happening.

Uploading a Sample

Which values shows the table and which values you expected?