# Access denied by Google BigQuery

**URL:** <https://community.opentargets.org/t/access-denied-by-google-bigquery/394>\
**Category:** Google BigQuery/Cloud\
**Created:** [1 November 2021 15:05 UTC](https://community.opentargets.org/t/access-denied-by-google-bigquery/394 "2021-11-01T15:05:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengysun](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mengysun](https://community.opentargets.org/u/mengysun)\
**Post date:** [1 November 2021 15:05 UTC](https://community.opentargets.org/t/access-denied-by-google-bigquery/394/1 "2021-11-01T15:05:26Z")

</div>

Hi Open target community,  
I am a postdoc researcher working at the Northwestern University. I am recently exploring the fantastic open target data. I am now trying to explore the data with the google big query. However, every time I try to follow the protocol of accessing the data through big query (i.e, following the instruction of [Get marketed drugs for a set of targets with BigQuery](https://community.opentargets.org/t/get-marketed-drugs-for-a-set-of-targets-with-bigquery/101)), it always said “Access Denied: Table open-targets-prod:platform\_21\_04.targets: User does not have permission to query table open-targets-prod:platform\_21\_04.targets”. I was wondering what could be wrong? Do I need to register a specific account and/or something else before doing that?  
Thanks!

---

<div class="post-metadata">

**Author:** ![irene](https://dub1.discourse-cdn.com/flex017/user_avatar/community.opentargets.org/irene/32/50_2.png) [@irene](https://community.opentargets.org/u/irene)\
**Post date:** [2 November 2021 16:34 UTC](https://community.opentargets.org/t/access-denied-by-google-bigquery/394/2 "2021-11-02T16:34:43Z")

</div>

Hi @mengysun!

That query is not working because it was referencing the data present in the 21.04 release, which is no longer available. To access the latest data in our Platform, simply use the `open-targets-prod.platform` dataset, which will always point to the dataset we have in production.  
This would be the correct query:

```auto
SELECT 
targets.approvedSymbol,
targets.id,
ARRAY_AGG(drugs.id) AS drugId
FROM `open-targets-prod.platform.molecule` AS drugs,
    UNNEST(linkedTargets.rows.list) AS linkedTarget
    JOIN `open-targets-prod.platform.targets` AS targets 
    ON targets.id = linkedTarget.element
WHERE drugs.maximumClinicalTrialPhase = 4 AND 
    targets.approvedSymbol IN (
        'ERBB3',
        'EGFR'
    )
GROUP BY targets.id, targets.approvedSymbol

```

The instructions you mentioned now point to the correct dataset. Thank you very much for reporting this!

Best,  
Irene

---

<div class="post-metadata">

**Author:** ![mengysun](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mengysun](https://community.opentargets.org/u/mengysun)\
**Post date:** [2 November 2021 18:24 UTC](https://community.opentargets.org/t/access-denied-by-google-bigquery/394/3 "2021-11-02T18:24:29Z")

</div>

Thanks a lot! This is very helpful!
