Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I solve the error "Dataset was not found in location US" in BigQuery?

I'm trying to run some tests with Google BigQuery to calculate data from my Google Spreadsheets. When trying to run the code, I am getting the error: "Dataset was not found in location US".

I have already tried processing the site in "Automatic" or "EU" in the query settings but neither of each has brought any useful results.

The code I used is this one here:

SELECT a.Customer AS Customer,
       round(100.00*sum(b.Online_Sales)/sum(a.Sales), 2) AS PctOnlineSales
FROM
    Dataset.Big_Data_Test_1_Sales a
JOIN
    Dataset.Big_Data_Test_1_Online_Sales b
ON a.Customer = b.Customer
--WHERE a.Customer IN ('1002')
GROUP BY 1
ORDER BY 1

I expected to multiply the data of two sheets that are schemed in my dataset.

Can you guys help me fix the location issue?

Thanks in advance! Nes

like image 304
Nes Elm Avatar asked Nov 24 '25 07:11

Nes Elm


1 Answers

Add your project Id before the dataset so BigQuery can locate it. This is an example based on your code

SELECT a.Customer AS Customer,
       round(100.00*sum(b.Online_Sales)/sum(a.Sales), 2) AS PctOnlineSales
FROM
 ProjectId.Dataset.Big_Data_Test_1_Sales a
JOIN ProjectId.Dataset.Big_Data_Test_1_Online_Sales b
ON a.Customer = b.Customer
--WHERE a.Customer IN ('1002')
GROUP BY 1
ORDER BY 1```
like image 57
Tamir Klein Avatar answered Nov 27 '25 21:11

Tamir Klein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!