Drill-through for SQL questions

In this doc you mention:

The Action Menu ’s drill-through functionality is available for questions built using the query builder and for SQL questions based on a model — as long as column metadata has been added to that model. You won’t have the option to drill-through on SQL questions that aren’t based on models, or if your models haven’t been annotated with the appropriate metadata.

For "SQL questions based on a model" - do you refer to the SQL question in which a model (versus a table in database ) is used in the "from" section (and the "join"section, if any)? Or do you mean we just turn the SQL question to a model?

Hi @xuheng925
Turn the SQL question in a Model and add Metadata. It has nothing to do with the query itself.

Appears that sql question with filters couldn't be turned into model. Then how could we enable drill-through for such sql question (given that drill-through is only available for sql question based on model)?

@xuheng925 You cannot do that. Either create a View on your database, so Metabase just sees a regular table. Or use Click Behavior to send users to other questions as "drill-through".

Is there any doc I can refer to for doing this?

@xuheng925
https://www.metabase.com/docs/latest/users-guide/interactive-dashboards.html
https://www.metabase.com/learn/dashboards/custom-destinations.html

Got it! I just tried the dashboard on-click feature and it is incredible! Thanks @flamber

Hi @flamber , @Luiggi ,

I have follow-on understanding needed after reading all the reference material.

All my questions are SQL coded with many left joins to connect tables. Imagine a order entry system with orders_tbl/order_id and orderItems_tbl / ordertbl_id as the linking one to many field.

what is the minimum i need to do with models etc. to link a drill through of the orders report/order-id column heading to branch to a separate sql question that lists the order items?

you can't do any drilling if you use SQL questions (unless you end up doing all your dashboards with click behaviour). You need to do all that with GUI questions

referring to this thread by @flamber, there is a method, so long as ...
The Action Menu ’s drill-through functionality is available for questions built using the query builder and for SQL questions based on a model — as long as column metadata has been added to that model. You won’t have the option to drill-through on SQL questions that aren’t based on models, or if your models haven’t been annotated with the appropriate metadata .

this is what i am referring to. what's the minimum needed to assocate drill through with sql?

Hi @flamber What I am doing is:

  • on top level sql question, i have defined the linking MB field as a link, also defined the field as external key
  • on the sub, drill down question, I have defined the linking field as external key, anso enclosed the linking field as double curly brackets, and specified its URL at the top level sql.

This does not product the desired result, Can you tell me what is missing?
thanks
Regis

@Luiggi , can you respond to this? thanks

@crwheelr Could you double check a few things?

  1. On the target question, test the URL parameter directly in the URL. Does it work?
  2. On the top level question if you mouse over the ID (or right click it and copy the link address) does it produce the correct URL for the target question? If not then:
  3. On the top level question confirm that the {{variable}} you've inserted into the target URL refers to the correct column on the top level question and retest the URL it generates until you see the correct path.

I hope this helps! If this

Thank yo isn't quite what you were looking for could you share more specific information about what you're expecting to happen VS what behavior you're observing?

Thank you!