[英]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.