How to use the same query SQL question to multiple cards (intention: make the dashboard load faster)

{
  "browser-info": {
    "language": "pt-BR",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0",
    "vendor": ""
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.7+10",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.7",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.7+10",
    "os.name": "Linux",
    "os.version": "4.14.181-142.260.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "9.5.5"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.8"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2020-05-28",
      "tag": "v0.35.4",
      "branch": "release-0.35.x",
      "hash": "b3080fa"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @Augusto
I don’t quite understand what you’re trying to do, but I would recommend that you read this:
https://www.metabase.com/blog/faster-dashboards/index.html
Perhaps you’re asking for Saved Questions, but it’s not obvious with the lack of details:
https://www.metabase.com/docs/latest/users-guide/custom-questions.html#picking-your-starting-data
By the way, latest release is 0.36.7

Thanks for the reply! So I have a big nasted query that it returns alot of data, and i would like to use this same question to create multiple cards like a Pie Chart, Total Numbers etc.
What i’m doing today is creating multiple questions and “calling” the same query multiple times to individually create this Cards on my Dashboard, what seems to make it pretty slow.
I would like to know if there is a simple way to resolve this like linked cards with multiple views but using the same result from a “Parent Question”
Other point is i’m using it embedded on my software (Since X Ray could be an option here)

Thank you for the link I do believe i can make it faster using a view data base for analytics :smile:

@Augusto You should probably look into optimizing your query, but you can reuse existing queries as Saved Question, like I linked to. Using cache would likely help as well.

1 Like

Thank you very much! Since i was always using native SQL i did not know the saved question on the custom questions :man_facepalming::man_facepalming:t5:
This will do the trick i was looking for.

Just one more related question. This main saved question query has a filter {{Client}} that i use to pass and embed the page with only specific client informations
In this case i can’t quite pull the filter outside of this saved question querry.

Then when a i use the saved question is there a way i pass the same filter to the saved question since i’ll get a error “You must pass the parameter Client”. So the only way i figured it out to do this is having a separated dashboard for each client

Hi @Augusto
It’s currently not supported to pass-thru filters from Saved Questions or Sub-Query variables - upvote by clicking :+1: on the first post of each issue:
https://github.com/metabase/metabase/issues/4367
https://github.com/metabase/metabase/issues/6449

1 Like