Announcements
MAINTENANCE ALERT: Dec. 12th starting 9 AM CET. Community will be read-only. GET DETAILS
cancel
Showing results for
Did you mean: Anonymous
Not applicable

## QlikMaps

I'm trying to create a density map. See below expression. My map fills with the same shade of color. What am I doing wrong?

=if(count(DISTINCT TOTAL [State]) = 1, RGB(127,39,4),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.1), RGB(255,245,235),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.2), RGB(254,230,206),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.3), RGB(253,208,162),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.4), RGB(253,174,107),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.5), RGB(253,141,60),
if(Sum(TOTAL <[State]> [PERS) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.6), RGB(241,105,30),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.7), RGB(216,88,15),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]),0.8), RGB(187,70,1),
if(Sum(TOTAL <[State]> [PERS]) <= fractile(TOTAL aggr(Sum([PERS]),[State]), 0.9), RGB(166,54,3),
RGB(127,39,4)))))))))))

1 Solution

Accepted Solutions Anonymous
Not applicable
Author

Formula is correct and can be used for a heat map. My data was incorrect as I had the State abvr joined to State.

3 Replies Anonymous
Not applicable
Author

Formula is correct and can be used for a heat map. My data was incorrect as I had the State abvr joined to State.  Partner - Creator

Hi mrjohn23,

My name is Trey Bayne and I work with the QlikMaps team. Another expression we have been playing with is as follows where \$1 is your measure and \$2 is your dimension:

pick(Ceil(rank(total sum(\$1))/Count(distinct TOTAL \$2)*7),

rgb(41,138,3),

rgb(65,156,33),

rgb(89,174,63),

rgb(113,192,94),

rgb(138,209,124),

rgb(162,227,154),

rgb(186,245,184))

This expression is much more efficient but sacrifices some resilience to poorly constructed data. One thing that has helped is clicking on the gears next to the dimension on the map object and selecting 'Suppress Null Values'.

If you try to use this and don't get the results you are expecting, select More under Map Properties and set Map Zoom equal to 0. This will allow you to view the map as a straight table to help identify where the issue with the data might be. happymapping‌ Anonymous
Not applicable
Author

Thanks, I'll give it a try. Community Browser