Forum Discussion
distance calculation : optimized route mapquest api
- 6 years ago
Here is some additional instruction
1. Starting with your existing query, group it on the Trip_ID and Start_Location columns, using the Group By button in the ribbon. Call the column "Locations". Choose All Rows as the aggregation.
2. Add a custom column called "ListOfLocations" with this formula - = List.Combine({{[START_LOCATION]}, [Locations][SERVED_LOCATION]})
3. Add a custom column called "ListInQuotes" with this formula - = Text.Combine(List.Transform([ListOfLocations], each """"&_&""""), ", ")
4. Concatenate that new column with the rest of your web call to get your results on each row/for each Trip_ID
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Here is some additional instruction
1. Starting with your existing query, group it on the Trip_ID and Start_Location columns, using the Group By button in the ribbon. Call the column "Locations". Choose All Rows as the aggregation.
2. Add a custom column called "ListOfLocations" with this formula - = List.Combine({{[START_LOCATION]}, [Locations][SERVED_LOCATION]})
3. Add a custom column called "ListInQuotes" with this formula - = Text.Combine(List.Transform([ListOfLocations], each """"&_&""""), ", ")
4. Concatenate that new column with the rest of your web call to get your results on each row/for each Trip_ID
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
It works great.
I would never had known how to do this by myself. Thank you very much for all your help !
Regards,
Marion