# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Contributor II

## Dimensional Expression issue in Color Properties

Hello Everyone,

Hope you are doing great. I am trying to create a PIE chart from the below expressions.

Dimension Expression:

=if(aggr(rank(sum([Total AUM])),[Product ID])<= 5,'Top 5 Products',

if(aggr(rank(sum([Total AUM])),[Product ID])> 5 and aggr(rank(sum([Total AUM])),[Product ID])<= 10,'Top 5 to 10 Products','The Rest'))

Measure Expression:

sum([Total AUM])

But the issue is with the color by dimension. By default whole PIE chart is showing in GRAY color.

Is there any way that I can choose my interest in color for dimension expression. For Exp 'Top 5 Product = Blue', 'Top 5 to 10 Products=lightblue and 'The Rest = LightGray'.

-Vidya

1 Solution

Accepted Solutions
Contributor II

## Re: Dimensional Expression issue in Color Properties

I was able to achieve this task with the below expression.

=if(max(aggr(rank(sum([Total AUM])),[Product ID]))<= vTopN,rgb(5,75,110),

if(max(aggr(rank(sum([Total AUM])),[Product ID]))> vTopN and max(aggr(rank(sum([Total AUM])),[Product ID]))<= vTopNtoN,rgb(7,197,222),rgb(117,117,117)))

Thanks,

-Vidya

3 Replies
Honored Contributor II

## Re: Dimensional Expression issue in Color Properties

Hi,

Try below method,

method 1: try to apply color by dimension using master item

method 2: background measure color as below expression

if(aggr(rank(sum(Sales)),Product)<= 5,Blue(),

if(aggr(rank(sum(Sales)),Product)> 5 and aggr(rank(sum(Sales)),Product)<= 10,LightBlue(),LightGray()))

also check this thread /post as well.

Color by expression ‒ Qlik Sense

Re: Problem with Color by Dimension

Thanks,Deva

Contributor II

## Re: Dimensional Expression issue in Color Properties

Hi Deva,

Thanks for looking into this. I have already tried this logic. Still no luck. I guess I have to create the rank and buckets calculated columns from load script editor and use that as a dimension in color properties.

Thanks,

-Vidya

Contributor II

## Re: Dimensional Expression issue in Color Properties

I was able to achieve this task with the below expression.

=if(max(aggr(rank(sum([Total AUM])),[Product ID]))<= vTopN,rgb(5,75,110),

if(max(aggr(rank(sum([Total AUM])),[Product ID]))> vTopN and max(aggr(rank(sum([Total AUM])),[Product ID]))<= vTopNtoN,rgb(7,197,222),rgb(117,117,117)))

Thanks,

-Vidya

Community Browser