Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
We are using Qlikview and Geoanalytics.
I have one question, we need to create chart layer and bubble layer but we don't have longitudine and latitudine.
we have Just shape.we created our layers based on first point of shape, but since they have overlapping, we need to change it,now I want to know is there any way in order to get central point of on shape?
Thank you in advance.
Regards,
Matsa
One way could be to use the average of coordinates. Works ok the shapes are fairly conform, not too "kidney like".
load cc, purgechar(replace(c_Geometry,'],[','|'),'[]') as plist Resident c;
pts: load cc, '[' & subfield(plist,'|') & ']' as pt Resident c;
// Extract coordinates
x: load cc, purgechar(subfield(pt,',',1),'[]') as x Resident pts;
y: load cc, purgechar(subfield(pt,',',2),'[]') as y Resident pts;
// Calculate center
cx: load cc, avg(x) as cx Resident x group by cc;
cy: load cc, avg(y) as cy Resident y group by cc;
See the example.
Thanks,
Patric
Hi Matsa,
If you happen to also be using Qlik Sense (some of our customer have dual licenses) - you could use the GeoGetPolygonCenter() function in the script and then write out the center points to bring back to QlikView. Unfortunately, I don't think the function exists in QlikView.
Hi @martyginqo ,Thank you for the response,unfortunatly we do not have license for qliksense.
anyway thank you for the information.
Regards,
Matsa
One way could be to use the average of coordinates. Works ok the shapes are fairly conform, not too "kidney like".
load cc, purgechar(replace(c_Geometry,'],[','|'),'[]') as plist Resident c;
pts: load cc, '[' & subfield(plist,'|') & ']' as pt Resident c;
// Extract coordinates
x: load cc, purgechar(subfield(pt,',',1),'[]') as x Resident pts;
y: load cc, purgechar(subfield(pt,',',2),'[]') as y Resident pts;
// Calculate center
cx: load cc, avg(x) as cx Resident x group by cc;
cy: load cc, avg(y) as cy Resident y group by cc;
See the example.
Thanks,
Patric