Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Google Static map sorting issue

Hi,

I am trying to get a Google static world heat map to work in QlikView.

The code-string I am using in a text object as an image and it works just fine (in fact the map is shown and the coloring is given to the selected countries) - but however the sorting of the values is not correct:

http://chart.apis.google.com/chart?&cht=t&chs=440x220&chtm=world&chco=f5f5f5,EEF3F7,517992,052A47&ch...

So according to above string the countries with the highest values should be Austria (AT) and Switzerland (CH) - which is not correct.

Does anybody have a suggestion to a solution for the correct values to be matched with the correct country code?

Thanks,

David

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What QV expression are you using to build the url?

Anonymous
Not applicable
Author

The chart expression is as follows:

='http://chart.apis.google.com/chart?&cht=t'

& '&chs=' & '440x220' /* Chart size */

& '&chtm=' & 'world' /* Region */

& '&chco=' & 'f5f5f5'  /* Color for no value */

& ',' & 'D5E3EC,517992,143C54'  /* Color gradient */

& '&chld=' & concat(DISTINCT [Country code], '', fieldIndex('ISO', [Country code]))

& '&chd=t:' & concat(ceil(aggr(100*sum(_Sales)/max(TOTAL aggr(DISTINCT sum(_Sales), [Country code])), [Country code])), ',', fieldIndex('ISO', [Country code]))



LOAD script:


Tmp:

LOAD * INLINE [

Country code, _Sales

QA, 50142

SG, 266437

TH, 267775

SK, 810146

SA, 341680

RO, 439454

TW, 607048

PT, 313915

SE, 2720556

RU, 4151880

]

;



The rendered map parameters:

http://chart.apis.google.com/chart?&cht=t&chs=440x220&chtm=world&chco=f5f5f5,D5E3EC,517992,143C54&ch...

However the correct CountryCode / Sales pairs should be as:

 

Country code=Sum(_Sales)
RU4 151 880
SE2 720 556
SK810 146
TW607 048
RO439 454
SA341 680
PT313 915
TH267 775
SG266 437
QA50 142

Thanks and BR,

David

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I don't see anything obvious. i suggest to start testing the expression a piece at a time in a text object.

-Rob