Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
Currently, I'm trying to combine two datasets: one with coordinates (latitude and longitude) and one with areas (polygons) both of which I have loaded separately, and all the data can be displayed in a map. However, I need to crear an intersection between those datasets by using the operation WITHIN in Qlik Cloud so that all my points are placed inside the areas.
1. First step was to load the data accordingly.
I have 6 main areas and lots of geo points.
2. I configured the connector both of which are loaded table
3. After adding the code from the connector, the script shows this error:
Something I noticed is that there is one table, and it says my enclosing data which is the area does not contain any geometries even if the areas can be displayed on a map. Also, I tried concatenating both table and I got the same error.
Could anyone guide me to do this, please?
Thanks a lot!
Hi @rolmontero ,
The problem is that you use 2 loaded tables, which is not supported:
"Only one inline table can be specified per operation. If you need to use data in two or more inline tables, you can use STORE to save the other inline tables as CSV files and then load from the CSV files."
It can be easily solved by storing the table first to csv and refering to that stored table:
PointData:
LOAD
IdPoint,
TIME_END,
LATITUD_INICIO,
LONGITUD_FIN,
Point
FROM [lib://DataFiles/Points.qvd]
(qvd);
Tmp:
LOAD
IdArea,
"Test KML CHile (1).Name",
Area
FROM [lib://DataFiles/AreaData.qvd]
(qvd);
store Tmp into [lib://DataFiles/AreaData.csv] (txt, delimiter is ';');
[WithinResultTable]:
Load * Extension GeoOperations.ScriptEval('
SELECT enclosed_enclosing_RelationId, IdPoint, IdArea, enclosed.Point, [enclosing.Test KML CHile (1).Name], enclosing.Area FROM
Within()
DATASOURCE enclosed INTABLE keyField="IdPoint", crs="auto", pointField="Point"
DATASOURCE enclosing CSV url="lib://DataFiles/AreaData.csv", keyField="IdArea", geometryField="Area", geometryType="polygon", fieldSeparator="SEMICOLON", recordSeparator="NEWLINE", crs="auto"
', PointData);
Grz
Joost
Hi!
Do you have the possibility to share the 2 tables? I'll take a look then.
Joost
Hi @rolmontero ,
The problem is that you use 2 loaded tables, which is not supported:
"Only one inline table can be specified per operation. If you need to use data in two or more inline tables, you can use STORE to save the other inline tables as CSV files and then load from the CSV files."
It can be easily solved by storing the table first to csv and refering to that stored table:
PointData:
LOAD
IdPoint,
TIME_END,
LATITUD_INICIO,
LONGITUD_FIN,
Point
FROM [lib://DataFiles/Points.qvd]
(qvd);
Tmp:
LOAD
IdArea,
"Test KML CHile (1).Name",
Area
FROM [lib://DataFiles/AreaData.qvd]
(qvd);
store Tmp into [lib://DataFiles/AreaData.csv] (txt, delimiter is ';');
[WithinResultTable]:
Load * Extension GeoOperations.ScriptEval('
SELECT enclosed_enclosing_RelationId, IdPoint, IdArea, enclosed.Point, [enclosing.Test KML CHile (1).Name], enclosing.Area FROM
Within()
DATASOURCE enclosed INTABLE keyField="IdPoint", crs="auto", pointField="Point"
DATASOURCE enclosing CSV url="lib://DataFiles/AreaData.csv", keyField="IdArea", geometryField="Area", geometryType="polygon", fieldSeparator="SEMICOLON", recordSeparator="NEWLINE", crs="auto"
', PointData);
Grz
Joost
Hi @joostvanegmond7 ,
Thanks a lot for you help. I just tried again based on your recommendation and it worked like a charm!
Have a great day and happy holidays!