简体   繁体   English

数据工作室如何从 Bigquery 制作普通表

[英]Data studio how to make a normal table from Bigquery

I have a Bigquery view, when I make a query on this view (Cloud console):当我对此视图(云控制台)进行查询时,我有一个 Bigquery 视图:

SELECT CREATED_ON, ACCOUNT_DN FROM dataset.BILLING_HISTORY where CREATED_ON = '2021-07-27T10:28:04Z';

I got the result:我得到了结果:

[{
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}, {
  "CREATED_ON": "2021-07-27T10:28:04Z",
  "ACCOUNT_DN": "f23f8cba-ef18-4245-95a0-cce3e671466c"
}]

Around 46 records (all CREATED_ON are the same, some ACCOUNT_DN are duplicated, this is my expectation result)大约 46 条记录(所有 CREATED_ON 都相同,一些 ACCOUNT_DN 重复,这是我的预期结果)

Now I want to make a table on Data studio (reflect this view).现在我想在 Data Studio 上制作一个表格(反映这个观点)。 My table setup and result:我的表格设置和结果:

数据工作室设置

As you can see, some ACCOUNT_DN are duplicated, this is normal, but all CREATED_ON are unique that is not my expectation.如您所见,一些 ACCOUNT_DN 重复,这是正常的,但所有 CREATED_ON 都是唯一的,这不是我的期望。 I just want to make a data studio table that cloned exactly from my Bigquery view (no need to count, group by, etc), but I don't know why the CREATED_ON get distinct.我只想制作一个从我的 Bigquery 视图中完全克隆的数据工作室表(无需计数、分组等),但我不知道为什么 CREATED_ON 变得不同。 Please help请帮忙

According to documentation :根据文件

Tables in Data Studio数据洞察中的表

Tables in Data Studio automatically group your data . Data Studio 中的表格会自动对您的数据进行分组 Each row in the table displays the unique combination of all the dimensions included in the table definition .表中的每一行都显示表定义中包含的所有维度的唯一组合 Each metric in the table is aggregated according to the aggregation type for that metric (sum, average, count, etc.).表中的每个指标都根据该指标的聚合类型(总和、平均值、计数等)进行聚合。

Workaround.解决方法。 You can add an additional unique column, for instance RowNumber :您可以添加一个额外的唯一列,例如RowNumber

SELECT  ROW_NUMBER() OVER(ORDER BY NULL) AS RN, 
        CREATED_ON,
        ACCOUNT_DN
FROM    dataset.BILLING_HISTORY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 BigQuery 从 json 数据列创建表/视图 - BigQuery make a table/view from json data column 数据洞察从 BigQuery 获取转置表并在文本/字符串中隐藏条件格式 - Data Studio obtain a transposed table from BigQuery and hidden conditional formatting in text/strings 从工作表到 BigQuery 表的数据连接器未导入 - Data Connectors from Sheets to BigQuery table not importing 如何将数据从一个表复制到另一个表中,该表在 GCP Bigquery 中有一个记录重复列 - How to copy data from one table into another table which has a record repeated column in GCP Bigquery 可以在 BigQuery 中以原子方式将数据从一个表移动到另一个表吗? - Possible to atomically move data from one table to another in BigQuery? 来自 bigquery 表的 DLP 数据扫描显示起始字节为 null - DLP data scan from bigquery table showing start byte as null 有没有办法从 bigquery 获取表详细信息选项卡元数据 - Is there a way to get the table details tab meta data from bigquery 如何将一个表中的列与 BigQuery 中另一个表中的数组进行比较? - How to compare column in one table with array from another table in BigQuery? 如何将 Data Studio 控件传递给 BigQuery 自定义查询 - How to pass Data Studio Controls to BigQuery custom query 如何从 Java 中的 BigQuery 获取分页数据? - How to get paginated data from BigQuery in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM