Use of database functions (routines) in questions #51441
Description
Is your feature request related to a problem? Please describe.
Sometimes I have imported (or created) certain functions in my database that are useful when representing data. For instance, the datetime records are in Gregorian calendar and I want to convert them to Jalali when displaying the data. There are existing functions for that purpose that we can use them in our database.
In Metabase, when creating raw questions, we cannot use any existing functions. The only available functions are COUNT, SUM, etc.
Describe the solution you'd like
It would be great if Metabase could read the functions (routines) from the database schemas as well as the tables. So we could use them along with other functions.
Describe alternatives you've considered
There are 3 sections in creating a raw question. We select the Data
(table columns, joining and custom columns with expressions), Filter
and Summarize
it.
The use of database functions can either take place in a 4th section (such as Display
or Representation
) or in the existing Data
section by means of custom expressions. In the latter scenario, the database functions should be valid to the expressions.
How important is this feature to you?
It is true that this feature is doable by means of SQL queries; but when the question is too complex, it's not the best practice to write a long query just because we need certain functions. Therefore, it's quite important to be able to use database functions in raw questions as well.
Additional context
Using database functions in SQL queries:
Using database functions in raw questions:
Activity