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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
andy
Partner - Creator III
Partner - Creator III

How to plot every n:th value in a xy-chart? (dynamic zoom in map, set-analysis)

Hi folks,

I'm having the standard googleMap XY-plot. My problem is that I'm plotting a long route on the map. The rest of the document requires a resolution of 1 meter so I'm having >200000 points which takes a lot of time in the XY-chart.

I would like only about 200 points being plotted when showing the whole route and then as the user zooms in still 200 points are plotted but distributed in the interval of the current selection.

See the attached simple document.

My dimension is called RPL.KP and is just an integer representing the meters.

My expressions are the standard ones

longitude:

--------

sum( round (256*pow(2,($(var_zoom)-1)))+( RPL.LongitudeDD *((256*pow(2,$(var_zoom)))/360)) )

latitude:

--------

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

I tried a calculated dimension looking as:

=if(mod(RPL.KP,1000)=1,RPL.KP)

This limits the points plotted and speed things up but you can never see any intermediate points between the kilometers first selected. It's not dynamic. Adding a dependency of the zoom-variable will not solve that since the user still makes an active selection in the chart of just a few points. This makes me wonder if this is possible. I have to clear the users selection of KP and make a new selection in the range of min(KP) to max(KP)

So then I turned into set-analysis adding this in the sum-expressions

{< RPL.KP = {">=$(=min(RPL.KP))<=$(=max(RPL.KP))"}}

This will select all the intermediate points in the selection but then I have to take every n:th value to limit the number of points to lets say 200.

I made a test by adding

- {"$(=mod(RPL.KP,1000)<>1)"

just to see if I could take every 1000:th point but this does not work. I guess I've reached the limit of my set-analysis knowledge....

Any help is appreciated.

/Andy

0 Replies