Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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!