Google Data Studio-完整的外部加入NULL值&枢轴表
Google Data Studio最近引入了新的加入操作,除了左外外连接外,全部外部联接是其中之一。完整的外部连接显然会导致混合表中的无效值。
如果我有下表(null
由-
表示的值),该表由与完整的外部加入的混合物产生,并在
- 公司表1< - &gt上加入。公司表2个
- 月表1< - >月表2
公司表1 | 公司表2个 | 月表1个 | 月表2 | 量表1 | 金额表2 |
---|---|---|---|---|---|
MUC MUC | MUC | 2月22 | 日22 | 1000 | 600 |
MUC MUC | MUC | 2月22日 | 2月22日22 | 800 | 200 200 |
MUC MUC | 22 | MAR 22 | MAR 22 MAR 22 | 800 | 200 200 |
MUC- | 22-22-22- | MUC | MUC | 900 | - |
MUC- | 月 | 至 | 22 | 日 | 200 |
5 和nary_max(金额表1,0)-nary_max(金额表2,0)
作为度量,我将获得以下
null null | 月22日 | 2月22日 | 2月22日, | 3月22日,3月22日 | |
---|---|---|---|---|---|
MUC | -400 | 600 | 600 | 900 | NULL |
1 | -200 | ------------------- | 但 | 我 | 尺寸 |
的问题是,如果我能以某种方式告诉数据工作室使用Dimensions 公司表2
和月表2
作为 如果表1的<代码> null 。
期望的结果将是
1月22日 | 2月22日 | 3月22日 | 4月22日4月22日 | 22日22 | |
---|---|---|---|---|---|
MUC | 400 | 600 | 600 | 900 | -200 |
在这里您可以在公开访问且可编辑的示例中找到上述数据,
有人对如何实现这一目标有想法吗?
Google Data Studio recently introduced new join operations additional to the left outer join, the full outer join being one of them. A full outer join can obviously often lead to null values in the blended table.
If I have the following table (null
values represented by -
) that results from a blend with a full outer join, with the join on
- Company Table 1 <-> Company Table 2
- Month Table 1 <-> Month Table 2
Company Table 1 | Company Table 2 | Month Table 1 | Month Table 2 | Amount Table 1 | Amount Table 2 |
---|---|---|---|---|---|
MUC | MUC | Jan 22 | Jan 22 | 1000 | 600 |
MUC | MUC | Feb 22 | Feb 22 | 800 | 200 |
MUC | MUC | Mar 22 | Mar 22 | 800 | 200 |
MUC | - | Apr 22 | - | 900 | - |
- | MUC | - | May 22 | - | 200 |
If I now create a pivot table from that blended data and I use Company Table 1
as row dimension and Month Table 1
as column dimension and NARY_MAX(Amount Table 1,0) - NARY_MAX(Amount Table 2,0)
as the metric, I get get the following
null | Jan 22 | Feb 22 | Mar 22 | Apr 22 | |
---|---|---|---|---|---|
MUC | - | 400 | 600 | 600 | 900 |
null | -200 | - | - | - | - |
This is quite understandable, but my question is, if I could somehow tell Data Studio to use the dimensions Company Table 2
and Month Table 2
as dimensions if the ones from Table 1 are null
.
The desired outcome would be
Jan 22 | Feb 22 | Mar 22 | Apr 22 | May 22 | |
---|---|---|---|---|---|
MUC | 400 | 600 | 600 | 900 | -200 |
Here you can finde the above data in a publicly accessible and editable example
Does anyone have an idea on how to accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cocesce
function(“ ” 返回第一个在字段列表中找到的非损坏值)可用于处理
null
在company> Company
和月中的值
值字段:1)公司Colesce
2)
=“ https://docs.google.com/spreadsheets/d/1yybgzftli4j9ewxwbmwyt30bc3sosoxz6anny5dbaa0/edit?usp
= sharing? “ https://i.sstatic.net/w2ek5.gif” alt =“ 4”>
The
COALESCE
function ("returns the first non-missing value found in a list of fields") can be used to deal with theNULL
values in both theCompany
andMonth
fields:1) Company COALESCE
2) Month COALESCE
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate: