Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
kavicsgym
Creator
Creator

Google Map calculates extremely slowly

Hi,

It is part of a SIB where we have:

1. invoice / sales data from SAP in a Fact table  (not more than 1 million rows)

2. Customer Dimension table with Customer ID and name (1000 customers)

3. Geographic Dimension table with Customer ID and Long / Lat data (I only have Long/Lat data for 200 customers)

The 3 tables are associated with a composed key (SAP Client/Mandant number + Customer ID).

The data volume is rather low, a couple of months data only. Now, if I select a single month, the map/scatter chart calculates in 3 minutes. If I select 1 month /1 customer the chart calculates in 30 sec. But if I select several months, it starts calculating and ends in “not responding”.

Any idea why it is so slow? Keys are OK. In the end we will have 50 million records …..

Thanks and cheers, Enikö

1 Solution

Accepted Solutions
Colin-Albert

You can test if len(longitude) >0 in the load script.

     If(len(longitude) > 0 and len(latitude) > 0, 1 ) AS LatLongOK

Then you can include    LatLongOK={1}  in your set expression to exclude data with invalid values.

View solution in original post

14 Replies
arthur_dom
Creator III
Creator III

hi Enikö .

What kind of Google map call are you using? Qlik Sense API , GeoQlik ou as background Image?

Colin-Albert

If your data is shown with the same expressions & dimensions in a straight table, do the calculation times change?

If not, then look at optimising your expressions & dimensions, the problem is not Google maps.

kavicsgym
Creator
Creator
Author

Hi, I use Google MAP API in QlikView, not QlikSense, not GeoQlik. The 'usual' Scatter plot with Latitude, Longitude and Sales Value expressions and dynamic image in the background of the scatter chart.

Any hint?

kavicsgym
Creator
Creator
Author

Hello Colin, thanks for your reply.

I changed the scatter chart into a normal Straight Table, cleared the slection (1 month, 1 customer) and it is not respondig for 2 hours now 🙂

In the same document, I have 10 other tabs with plenty of objects and they all work fine with same expressions (sum of sales, etc.).

This has sg to do with Lat/Long calculations in my honest oppinion.

I even disabled the 3rd expression (sum of sales) but same result

Do you think it matters that I only have Long/Lat data for a minority of the customers?

My other idea is that data is in 3 tables now, 1 fact and 2 dimensions (customers, lat/long data). - but it is a clear model.

Which could be more responsible for such a bad performance? Enikö

jpenuliar
Partner
Partner

Hi  Enikö,


Can you post a sample file, codes or table view to look at.


JP

Colin-Albert

Can you push the lat / long calculations into the script rather than in the chart.

How granular do you need the lat / long calculations for each location?

Can you map a town or area to last long rather than mapping each individual site?

You could then link a lat/long table to the town or area field rather than calculating it for every customer.


kavicsgym
Creator
Creator
Author

Hey, I can only attach a snipet from the Data Model which I have described above.

Also the 'empty' map chart.

This is the very standard Google Map API implementation that is published all over the forums. ('Step by step ...)

Script is from a working app.

And it works here as well, just with very limited selection.

Issue is when slightly more data is slected...

Appreciate every feedback. Enikö

arthur_dom
Creator III
Creator III

You can make some points to make it better, like pre-filter points, or eliminate Clients without Lat/Long using set analysys.

I think the better way is to reduce calculation

kavicsgym
Creator
Creator
Author

Well, we have to show the map by customer, not by town or area.

What do you mean by: " push the lat / long calculations into the script rather than in the chart"

The chart expressions (below) should be calculated in the script as 2 fields and just sum them up in the scatter chart?

Longitude:

=sum( round (256*pow(2,($(var_zoom)-1)))+( Longitude *((256*pow(2,$(var_zoom)))/360)))

Latitude:

=sum(((256*pow(2,($(var_zoom)-1)))+((0.5*log((1+(sin((Latitude)*pi()/180)))/(1-(sin((Latitude)*pi()/180)))))*((-256*pow(2,$(var_zoom)))/(2*pi())))))

This is a good idea, but still does not explain the performance issue I am having...

I attached below some samples.

Thanks a lot, Enikö