Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Import a nested table from Google Big Query

Hi,   I've been trying to import a nested table from Google Big Query, but all I can get is three columns, one of which seems to contain all the data within the nested columns (in a format I cannot...
  • Anonymous's avatar
    Anonymous
    5 years ago

    For anybody who's having the same problem, here's how I managed to solve it.

     

    The thing is, when you import nested tables from Google BigQuery, Power BI has trouble identifying the column names because the column names, when unnested, look something like this (in my case): list.element.name

     

    To work around it, what I did was get the data through an ODBC query, in which I manually specified new column names for the columns that needed to be unnested. It looked something like this:

        SELECT
            id,

            date,
            unnested.element.rule_name AS rule_name,
            unnested.element.is_rejected AS is_rejected,
            unnested.element.rule_scope AS rule_scope
        FROM
            `my_data_location`,
        UNNEST(list) as unnested