5

When I'm building a report in Google Data Studio from a MySQL source, I appear to only ever be able to work with 1 table per data source:

enter image description here

If I attempt to edit or change the datasource, I'm simply shown the single table that was selected when I created the datasource:

enter image description here

I need to join this table with another table. In this particular instance, I want to join with customer on customer_id to pull in customer data so that I can attach the customer's address to the Geo Map object on my report. You can see that object in the first screenshot.

Is there a way to join 2 tables and work with their data when building reports? The help docs aren't clear to me in this regard, and it appears to me that when you build a data source from an external database, you're forced to drill down all the way to the table level. Do I need to create 2 datasources to pull info from 2 different tables in the same database? If so, can they be joined so that data from both is available in the same report?

2
  • Then your question is unclear. Some screen shots might be useful.
    – ale
    Commented Sep 14, 2016 at 17:15
  • 1
    I've added screenshots to be more clear. Thanks for adding the tag. It is a relatively new product, I think more people will be asking questions about how to use it as time goes on. I've reached out to someone at Google for help as well – if I get this working I'll post back with an answer. Commented Sep 14, 2016 at 17:31

3 Answers 3

5

According to the docs as of this posting:

A Data Studio data source can connect to a single MySQL database table.

You can use multiple data sources (read: tables) in the same report, but you can't join them to use multiple data sources in one object, such as a bar graph or geo map. I was told by someone on the Data Studio team that joins are on their roadmap.

3

You can actually add a joined tables to Google Data Studio - but it requires an extra step. In your mysql database, you must first create a view of the joined tables.

Here is a link that explains how to do that: https://stackoverflow.com/questions/12352048/mysql-create-view-joining-two-tables

When you connect to your mysql datasource the joined view will show up in the list as a table in your selected database.

4
  • Great idea! Thanks for sharing. Commented Sep 30, 2016 at 17:26
  • Could you please clarify how to make the views show up in Google Data Studio? I created a view in my MySQL database, but it does not appear when I create a new datasource with this MySQL connection, I only see my tables. Thanks. Commented Dec 30, 2016 at 12:51
  • @MartijndeMilliano Did you solve the issue? I was wondering about the same thing.
    – Gesias
    Commented Mar 19, 2017 at 0:09
  • If someone comes back here, what I had to do was to create a brand new data source and then the view appeared.
    – Gesias
    Commented Mar 19, 2017 at 11:32
0

The Data Studio MySQL connector accepts a SQL query, so you can JOIN the tables freely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.