Variable SQL generates errors when I query my bigquerry DB

I have connected metabase to my bigquerry database. After connection, I can see all the tables in my DB perfectly but I get errors when creating my queries.

Without variables my query works normally
but using database variables causes errors

Please can you help me ??


Please send us the entire error and which Metabase version you're using

@arakaki

Hi, i use 0.46.6 version

You're querying the order_view table but adding a filter on the OrderAnalysis table, and there are no joins.

The filter will only work if you assign a field of the table you're querying or a joined table.

@arakaki now the filter is on order_view but i hame the same error

@arakaki what is the problem ??

My problem has no solution ??

Please post the entire query

That is the entire query

There is an eyeball icon near the variables and refresh buttons. It shows the compiled query. Can you send us this?

If you try to run this query, does it fail? this looks exactly like the first query you posted here

Sorry i make confusion .
That is the correct compiled query

That query will never run, it’s using a where clause with a field of a table which is not included in the FROM

@Luiggi @arakaki

I've connected bigauerry to metabase, so I can see all the tables in metabase directly.

  1. why do you require in the from clause that we fill in this whole path biplife-66cc9.biplife_export.orders_view when we could just do from orders_view since the table is already present on metabase ??

  2. What do I have to do for my query to work?

If I do a query like:
Select * from table_a where table_b.source = “something”

… that will not work

Please connect the filter with the view rather than with the source table

@Luiggi
I do not understand
What are you referring to when you talk about the view and the source table?

@Luiggi @arakaki

I think the problem comes from the fact that the {{date}} variable points to metabase, hence the acronym biplife_export.orders_view, even though my from is on biplife-66cc9.biplife_export.orders_view.

Basically, my {{date}} variable doesn't point directly to bigquerry, at least that's what I think.

Anyway, can you tell me how to use metabase variables when querying bigquerry?


@Luiggi @arakaki

is it possible for me to have an example or link or anything to solve my problem?