Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vidyasagar159
Creator II
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'.


Thanks in Advance!!

-Vidya

1 Solution

Accepted Solutions
vidyasagar159
Creator II
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

View solution in original post

3 Replies
devarasu07
Master II
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

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

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