Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Cycle through a list of airport names and query a database

mmarino
5 - Atom

I currently have the following process built in Excel VBA and I’m attempting to convert it to Alteryx. I believe an Iterative macro needs to be used but I stuck on how to build it out… I’m new to Alteryx and it’s above my skill level at this moment…

 

Use case: Cycle through a list of airport names and query a database, place the returned data into a table, all data would be appended into one table.

mmarino_1-1677011915219.png

Curl query example:
-o -XPOST http://xxx.xxx.xxx.xxx:8086/query? --data-urlencode "q=SELECT max(traffic_in) AS max_in, max(traffic_out) As max_out FROM "traffic_rate" WHERE airport_code =~ /^" & AIRPORT & "/ and time >= now()-7d GROUP BY time(1d), airport_code;" -H "Accept: application/csv"

 

If an airport code (e.g. SEA) is hard coded in the query, the “Run Command” tool works. However, I’m not able to figure out how to create a macro to cycle through a list airport codes.

 

Thank you in advance!

Mike

2 REPLIES 2
binuacs
21 - Polaris

@mmarino Can you provide a sample input file and expected output file, that would be very easy to understand your use case?

mmarino
5 - Atom

Attached is a small sample of the airport code inputs and InfluxDB outputs.

Just to recap, take the first airport code and query the DB, then take next airport code in the list and query the DB, and so on…


Thank you.

 

Labels
Top Solution Authors