Search code examples
foreign-keyslooker-studio

How to add a foreign key to Google Data Studio Blend


I have 3 tables and I want to get different data for a chart. First and second have a common key, second and third have a common key, but first and third does not.

EXAMPLE DATA:

TABLE product data

product ID

product category

TABLE orders

order ID

Product ID

sale price

TABLE order logistics

order ID

Client ID

Client's country

What I want to achieve is a graph that shows: Sum of sale prices for all product in category "cars" bought by client from country "USA"

I know how to use filters and how to make graph, my problem is how to get my data together in one document.

I know that I can modify data and add lookups in Google Sheets but as my data has 100 000+ rows I am looking for a more efficient solution than vlookup between tables in Google Sheets.

So far I could Blend data only when common key was present.


Solution

  • Blend in Data Studio needs the same common keys for all data sources. You need to do these joins in BigQuery.