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
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
s_santalucia
Partner - Creator
Partner - Creator

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
kaanerisen
Creator III
Creator III

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
kaanerisen
Creator III
Creator III

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.

s_santalucia
Partner - Creator
Partner - Creator
Author

Hi,

it doesn't work.

kaanerisen
Creator III
Creator III

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

kaanerisen
Creator III
Creator III

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

s_santalucia
Partner - Creator
Partner - Creator
Author

yes

s_santalucia
Partner - Creator
Partner - Creator
Author

IT'S OK!

Thanks!