Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Color maps by max expression

Hi all,

I want to color maps by expression.

e.x.:

I have Italy maps and I want to color the region by num max of type car in that region;

(if num max of type car is BMW, color red!

Thanks!

1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Re: Color maps by max expression

Ah sorry. you should also add region field to the aggr function.

Pick(Match(FirstSortedValue(BRAND,-aggr(sum(QTY),BRAND,REGION)),'BMW','AUDI','MERCEDES'),Red(),Green(),Blue())

Untitled.png

View solution in original post

6 Replies
Highlighted
Creator III
Creator III

Re: Color maps by max expression

Hi Stefania,

It should be sth like that.

Pick(Match(FirstSortedValue(BRAND,-aggr(sum(QUANTITY),BRAND)),'BMW','AUDI','MERCEDES'),Red(),Green(),Blue())

BMW will be red, AUDI will be Green and MERCEDES will be Blue with this expression.

Highlighted
Partner
Partner

Re: Color maps by max expression

Hi,

it doesn't work.

Highlighted
Creator III
Creator III

Re: Color maps by max expression

Can you share the app qvf file? If you can, I will look into the problem.

Highlighted
Creator III
Creator III

Re: Color maps by max expression

Ah sorry. you should also add region field to the aggr function.

Pick(Match(FirstSortedValue(BRAND,-aggr(sum(QTY),BRAND,REGION)),'BMW','AUDI','MERCEDES'),Red(),Green(),Blue())

Untitled.png

View solution in original post

Highlighted
Partner
Partner

Re: Color maps by max expression

yes

Highlighted
Partner
Partner

Re: Color maps by max expression

IT'S OK!

Thanks!