4 Replies Latest reply on Dec 6, 2016 7:42 AM by Ben Powis

    Custom SQL to BigQuery Error

    Ben Powis

      Hi everyone,

       

      I am trying to run custom SQL in Tableau to read data from BigQuery. The query works just fine on BigQuery's web UI, but in Tableau I get the following error:

       

      The Google BigQuery service was unable to compile the query.

      Field 'device_browserVersion' not found.

      However, the field does exist in BQ.

       

      Here is my query:

       

      SELECT visitId, date, totals.visits,
                            totals.hits,
                            totals.pageviews,
                            totals.timeOnSite,
                            totals.bounces,
                            totals.transactions,
                            totals.newVisits,
                            totals.totalTransactionRevenue,
                            trafficSource.campaign,
                            trafficSource.source,
                            trafficSource.medium,
                            trafficSource.keyword,
                            trafficSource.adContent,
                            device.browser,
                            device.browserVersion,
                            device.isMobile,
                            device.mobileDeviceBranding,
                            device.mobileDeviceModel,
                            device.mobileDeviceInfo,
                            device.mobileDeviceMarketingName,
                            device.deviceCategory,
                            geoNetwork.continent,
                            geoNetwork.subContinent,
                            geoNetwork.country,
                            geoNetwork.region,
                            geoNetwork.metro,
                            geoNetwork.city,
                            geoNetwork.cityId,
                            geoNetwork.latitude,
                            geoNetwork.longitude,
                            channelGrouping,
                            socialEngagementType
      FROM (TABLE_DATE_RANGE([*TABLE NAME REMOVED*], DATE_ADD(CURRENT_TIMESTAMP(), -7, 'DAY'), DATE_ADD(CURRENT_TIMESTAMP(), -1, 'DAY')))
      WHERE totals.transactions > 0
      GROUP BY visitId, date, totals.visits,
                              totals.hits,
                              totals.pageviews,
                              totals.timeOnSite,
                              totals.bounces,
                              totals.transactions,
                              totals.newVisits,
                              totals.totalTransactionRevenue,
                              trafficSource.campaign,
                              trafficSource.source,
                              trafficSource.medium,
                              trafficSource.keyword,
                              trafficSource.adContent,
                              device.browser,
                              device.browserVersion,
                              device.isMobile,
                              device.mobileDeviceBranding,
                              device.mobileDeviceModel,
                              device.mobileDeviceInfo,
                              device.mobileDeviceMarketingName,
                              device.deviceCategory,
                              geoNetwork.continent,
                              geoNetwork.subContinent,
                              geoNetwork.country,
                              geoNetwork.region,
                              geoNetwork.metro,
                              geoNetwork.city,
                              geoNetwork.cityId,
                              geoNetwork.latitude,
                              geoNetwork.longitude,
                              channelGrouping,
                              socialEngagementType
      

       

      Can anyone suggest a fix for this? Is there some formatting error in the query that Tableau does not like?

       

      Thank you for your help,

      Ben