Announcements
Applications are open for the 2024 Qlik Luminary Program. Apply by December 15 here.
cancel
Showing results for
Did you mean:  Creator 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  Creator II
Author

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  Master II

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  Creator II
Author

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  Creator II
Author

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 Tags
Community Browser