0

I have a data looker report that runs on a specific table schema. However those tables are generated automatically and I want to run the same report over different tables that are generated automatically. (over 1000)

How can I achieve that? Tried with dynamic SQL and it doesn't work (see below). Did anyone happened to solve such a solution?

Seems that bigquery custom SQL doesn't allow to use params in as table names:

This one won't work:

DECLARE tablename STRING;
SET tablename = "100_dwd_rfm_analysis_ms";

select * from tablename

Neither passing the whole SQL as a custom query:

@custom_query

And this one doesn't either:

select * from database.@table_name
Alexandru R
  • 8,560
  • 16
  • 64
  • 98

0 Answers0