Variable not transfering from main query to visual query

Hello,

I have a question regarding variables used in filter.

In fact, I did a big SQL Query.
From this, I did multiple visuals for which the query then looks like
SELECT source. field
FROM (big source query) source
If I adapt the source query, it well adapts in the visual query. That's perfect.
However, if I put variables in my main query, these variables are not integrated in the visuals queries...
Consequently, I cannot use these variables in filters (to get the list of values) in the dashboard.

Can you help me ? Thank you in advance!

Hi @MarieG
I don't understand what you mean. Try including your query with the variables.
You cannot pass-thru variables to nested questions, if that is what you are trying to explain.

Hi @flamber,

Thank you for your quick answer !

I'm new in Metabase and not yet very at my ease with objects definition.
I think you answered my question saying we cannot pass-thru variables to nested questions, if, by nested question, you mean derived question from an orginial SQL Query (to different objects).

Here is an example that I hope will make my question clearer :

  • Main query :
    select fieldA, fieldB, fieldC from Table A where {{variable}}
  • Query in visual :
    select source.fieldA, sum(source.fieldB) as Value
    from (select fieldA, fieldB, fieldC from Table A) source
    group by source.fieldA
    --> variable missing

@MarieG Correct, it's quite complex to implement and involves a lot of permissions:
https://github.com/metabase/metabase/issues/6449 - upvote by clicking :+1: on the first post

You would have to either just use SQL, or just do everything in the GUI.

Ok, Thank you for your help !