You want to run a query over multiple tables in your database / warehouse and then process and visualise the combined results of those queries. You need to be able to switch between servers, databases, schemas and tables, selecting different columns and applying different conditions in the WHERE clause. You don’t have permsissions to write complex / dynamic SQL (for example you can’t create stored procedures or query system tables).
Are you stumped?
Not if you know R!
Here’s one way to do it..
- Set up a config file. This is a YAML file, where you store all the parameters, and possible values for each of those, in the order you want to loop through them.
- Write a SQL query using glue_SQL to allow for interpolating