<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic REST Connector Map Route API - Set Querys as Variable in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-Connector-Map-Route-API-Set-Querys-as-Variable/m-p/1646335#M4641</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;I have an API from the map provider HERE which allows me to calculate the distances between two locations. (&lt;A href="https://developer.here.com/documentation/routing/dev_guide/topics/request-a-simple-route.html" target="_blank" rel="noopener"&gt;https://developer.here.com/documentation/routing/dev_guide/topics/request-a-simple-route.html&lt;/A&gt;) Now I wanted to define the query for waypoint 0 and waypoint 1 as variables in the script. (see screenshot)&lt;/P&gt;&lt;P&gt;As source data I have a table (Destinations) with customer names and longitudes and latitudes. And the table Origin with my location as longitude and latitude.&lt;/P&gt;&lt;P&gt;How do I get it to loop through the Origins and Destinations? I tried with "With Connection" but it doesnst work. I hope you have understood my problem and can help me. Thank you .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Origins&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Standort&lt;/TD&gt;&lt;TD&gt;long&lt;/TD&gt;&lt;TD&gt;lat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Adlershof&lt;/TD&gt;&lt;TD&gt;52.440075&lt;/TD&gt;&lt;TD&gt;13.5241164&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Destination&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;long&lt;/TD&gt;&lt;TD&gt;lat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Kunde A&lt;/TD&gt;&lt;TD&gt;48.135124&lt;/TD&gt;&lt;TD&gt;11.581981&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Kunde B&lt;/TD&gt;&lt;TD&gt;49.006889&lt;/TD&gt;&lt;TD&gt;8.403653&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vOrigin = Origin;&lt;BR /&gt;let vDestination = Destination;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Origins&lt;/STRONG&gt;:&lt;BR /&gt;LOAD&lt;BR /&gt;'geo!'&amp;amp;long&amp;amp;','&amp;amp;lat as Origin, (format for API)&lt;BR /&gt;&lt;BR /&gt;Standort,&lt;BR /&gt;long,&lt;BR /&gt;lat&lt;BR /&gt;FROM [lib://Downloads/Origins.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Destinations&lt;/STRONG&gt;:&lt;BR /&gt;Load&lt;BR /&gt;'geo!'&amp;amp;long&amp;amp;','&amp;amp;lat as Destination, (format for API)&lt;BR /&gt;&lt;BR /&gt;Name,&lt;BR /&gt;long as dlong,&lt;BR /&gt;lat as dlat&lt;BR /&gt;FROM [lib://Downloads/Adressen.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'Here';&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"__KEY_response",&lt;BR /&gt;(SELECT&lt;BR /&gt;"__FK_route",&lt;BR /&gt;"__KEY_route",&lt;BR /&gt;(SELECT&lt;BR /&gt;"distance",&lt;BR /&gt;"trafficTime",&lt;BR /&gt;"baseTime",&lt;BR /&gt;"text",&lt;BR /&gt;"travelTime" AS "travelTime_u1",&lt;BR /&gt;"_type" AS "_type_u0",&lt;BR /&gt;"__KEY_summary",&lt;BR /&gt;"__FK_summary",&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Value" AS "@Value_u2",&lt;BR /&gt;"__FK_flags"&lt;BR /&gt;FROM "flags" FK "__FK_flags" ArrayValueAlias "@Value_u2")&lt;BR /&gt;FROM "summary" PK "__KEY_summary" FK "__FK_summary")&lt;BR /&gt;FROM "route" PK "__KEY_route" FK "__FK_route")&lt;BR /&gt;FROM JSON (wrap off) "response" PK "__KEY_response"&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;WITH CONNECTION(&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;QUERY "waypoint0" "$(Origin)",&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;QUERY "waypoint1" "$(vDestination)"&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;[&lt;STRONG&gt;flags&lt;/STRONG&gt;]:&lt;BR /&gt;LOAD [@Value_u2],&lt;BR /&gt;[__FK_flags] AS [__KEY_summary]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_flags]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[&lt;STRONG&gt;summary&lt;/STRONG&gt;]:&lt;BR /&gt;LOAD [distance],&lt;BR /&gt;[trafficTime],&lt;BR /&gt;[baseTime],&lt;BR /&gt;[text],&lt;BR /&gt;[travelTime_u1] AS [travelTime_u1],&lt;BR /&gt;[_type_u0] AS [_type_u0],&lt;BR /&gt;[__KEY_summary],&lt;BR /&gt;[__FK_summary] AS [__KEY_route]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_summary]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP TABLE RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.png" style="width: 592px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23552iD9673D31EBFB42A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.png" alt="Error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 11:39:19 GMT</pubDate>
    <dc:creator>ahmada</dc:creator>
    <dc:date>2019-11-13T11:39:19Z</dc:date>
    <item>
      <title>REST Connector Map Route API - Set Querys as Variable</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-Connector-Map-Route-API-Set-Querys-as-Variable/m-p/1646335#M4641</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I have an API from the map provider HERE which allows me to calculate the distances between two locations. (&lt;A href="https://developer.here.com/documentation/routing/dev_guide/topics/request-a-simple-route.html" target="_blank" rel="noopener"&gt;https://developer.here.com/documentation/routing/dev_guide/topics/request-a-simple-route.html&lt;/A&gt;) Now I wanted to define the query for waypoint 0 and waypoint 1 as variables in the script. (see screenshot)&lt;/P&gt;&lt;P&gt;As source data I have a table (Destinations) with customer names and longitudes and latitudes. And the table Origin with my location as longitude and latitude.&lt;/P&gt;&lt;P&gt;How do I get it to loop through the Origins and Destinations? I tried with "With Connection" but it doesnst work. I hope you have understood my problem and can help me. Thank you .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Origins&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Standort&lt;/TD&gt;&lt;TD&gt;long&lt;/TD&gt;&lt;TD&gt;lat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Adlershof&lt;/TD&gt;&lt;TD&gt;52.440075&lt;/TD&gt;&lt;TD&gt;13.5241164&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Destination&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;long&lt;/TD&gt;&lt;TD&gt;lat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Kunde A&lt;/TD&gt;&lt;TD&gt;48.135124&lt;/TD&gt;&lt;TD&gt;11.581981&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Kunde B&lt;/TD&gt;&lt;TD&gt;49.006889&lt;/TD&gt;&lt;TD&gt;8.403653&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vOrigin = Origin;&lt;BR /&gt;let vDestination = Destination;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Origins&lt;/STRONG&gt;:&lt;BR /&gt;LOAD&lt;BR /&gt;'geo!'&amp;amp;long&amp;amp;','&amp;amp;lat as Origin, (format for API)&lt;BR /&gt;&lt;BR /&gt;Standort,&lt;BR /&gt;long,&lt;BR /&gt;lat&lt;BR /&gt;FROM [lib://Downloads/Origins.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Destinations&lt;/STRONG&gt;:&lt;BR /&gt;Load&lt;BR /&gt;'geo!'&amp;amp;long&amp;amp;','&amp;amp;lat as Destination, (format for API)&lt;BR /&gt;&lt;BR /&gt;Name,&lt;BR /&gt;long as dlong,&lt;BR /&gt;lat as dlat&lt;BR /&gt;FROM [lib://Downloads/Adressen.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Tabelle1);&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'Here';&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"__KEY_response",&lt;BR /&gt;(SELECT&lt;BR /&gt;"__FK_route",&lt;BR /&gt;"__KEY_route",&lt;BR /&gt;(SELECT&lt;BR /&gt;"distance",&lt;BR /&gt;"trafficTime",&lt;BR /&gt;"baseTime",&lt;BR /&gt;"text",&lt;BR /&gt;"travelTime" AS "travelTime_u1",&lt;BR /&gt;"_type" AS "_type_u0",&lt;BR /&gt;"__KEY_summary",&lt;BR /&gt;"__FK_summary",&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Value" AS "@Value_u2",&lt;BR /&gt;"__FK_flags"&lt;BR /&gt;FROM "flags" FK "__FK_flags" ArrayValueAlias "@Value_u2")&lt;BR /&gt;FROM "summary" PK "__KEY_summary" FK "__FK_summary")&lt;BR /&gt;FROM "route" PK "__KEY_route" FK "__FK_route")&lt;BR /&gt;FROM JSON (wrap off) "response" PK "__KEY_response"&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;WITH CONNECTION(&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;QUERY "waypoint0" "$(Origin)",&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;QUERY "waypoint1" "$(vDestination)"&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;[&lt;STRONG&gt;flags&lt;/STRONG&gt;]:&lt;BR /&gt;LOAD [@Value_u2],&lt;BR /&gt;[__FK_flags] AS [__KEY_summary]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_flags]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[&lt;STRONG&gt;summary&lt;/STRONG&gt;]:&lt;BR /&gt;LOAD [distance],&lt;BR /&gt;[trafficTime],&lt;BR /&gt;[baseTime],&lt;BR /&gt;[text],&lt;BR /&gt;[travelTime_u1] AS [travelTime_u1],&lt;BR /&gt;[_type_u0] AS [_type_u0],&lt;BR /&gt;[__KEY_summary],&lt;BR /&gt;[__FK_summary] AS [__KEY_route]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_summary]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DROP TABLE RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.png" style="width: 592px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/23552iD9673D31EBFB42A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.png" alt="Error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 11:39:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/REST-Connector-Map-Route-API-Set-Querys-as-Variable/m-p/1646335#M4641</guid>
      <dc:creator>ahmada</dc:creator>
      <dc:date>2019-11-13T11:39:19Z</dc:date>
    </item>
  </channel>
</rss>

