Variable SQL generates errors when I query my bigquerry DB

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?

please consider this is a "best effort" type of support, we're not able to set up a bigquery account, develop a similar case to what you're seeing and come up with a solution. We need a few weeks to see what's going on here

Nevertheless, do you have cases where you use metabase variables on a bigquerry table ? @Luiggi

@Luiggi @arakaki

I found the solution in a post from 2021.
Basically, the from-clause should be without Project ID

Maybe this will help others when the time comes.
Thanks for your contributions