error create dimension Query execution failed: - Scalar subquery produced more than one element

Hello, please I want to create a dimension that contains all the products that were purchased last year. I have error :

The Google BigQuery Standard SQL database encountered an error while running this query.

Query execution failed: - Scalar subquery produced more than one element

dimension: P_comparable {
    type: string
    sql: (SELECT ${products} FROM ods.magasin WHERE ${buy_date} between '2019-01-01' AND '2019-12-31');;
  }

0 1 2,585
1 REPLY 1

What is ${products}?

I’m going to assume that you’re trying to put a multiple rows result set into one string. To do that you may need to use GROUP_CONCAT but I would make sure the query runs in BQ first

Top Labels in this Space
Top Solution Authors