Entity key not working in native query

Hi all! I’m using latest version ( v0.33.1) and I ran with an issue with some visualizations for a Oracle DB.

I edited field “ID Tarea” metada as “Entity key”:

So, in a simple query table type visualization it resolves OK: it identifies correctly the field value as the only identifier of the row (and colors it blue). But when I use the same table with a native query type visualization, this doesn’t happen:

Can you take a look at this? anybody seen something like this before?

Thanks! :grinning:

The blue signifies that you can drill through to the record. That concept doesn’t exist in a native query, so it’s correct.
If you look in the Data Model, you’ll see that the column is identified as the Entity Key or as a Foreign Key:

1 Like

Oh! It would be awesome to have this functionality in native queries. Because I need to calculate date differences using SYSDATE or CURRENT_DATE. Thanks for the info! :grinning:

@santiago.lator Your best solution would be to create a View in your database, so Metabase just uses that, which would make it behave like a normal table with drill-through.

1 Like

@flamber Thanks for the idea! I don’t have permission to do that on this particular db, but I will take this on consideration :100:

@santiago.lator Another option is to create the calculated query in SQL, and then create a new question based on that SQL-question - that’s known as Saved Questions.
There are some limitations and issues, so I don’t know if it will work in your case, but try.

1 Like