Google Data Studio-完整的外部加入NULL值&枢轴表

发布于 2025-02-03 18:55:01 字数 1945 浏览 3 评论 0原文

Google Data Studio最近引入了新的加入操作,除了左外外连接外,全部外部联接是其中之一。完整的外部连接显然会导致混合表中的无效值。

如果我有下表(null-表示的值),该表由与完整的外部加入的混合物产生,并在

  • 公司表1< - &gt上加入。公司表2个
  • 月表1< - >月表2
公司表1公司表2个月表1个月表2量表1金额表2
MUC MUCMUC2月22日221000600
MUC MUCMUC2月22日2月22日22800200 200
MUC MUC22MAR 22MAR 22 MAR 22800200 200
MUC-22-22-22-MUCMUC900-
MUC-22200

5 和nary_max(金额表1,0)-nary_max(金额表2,0)作为度量,我将获得以下

null null月22日2月22日2月22日,3月22日,3月22日
MUC-400600600900NULL
1-200-------------------尺寸

的问题是,如果我能以某种方式告诉数据工作室使用Dimensions 公司表2月表2作为 如果表1的<代码> null 。

期望的结果将是

1月22日2月22日3月22日4月22日4月22日22日22
MUC400600600900-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 1Company Table 2Month Table 1Month Table 2Amount Table 1Amount Table 2
MUCMUCJan 22Jan 221000600
MUCMUCFeb 22Feb 22800200
MUCMUCMar 22Mar 22800200
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

nullJan 22Feb 22Mar 22Apr 22
MUC-400600600900
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 22Feb 22Mar 22Apr 22May 22
MUC400600600900-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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人间☆小暴躁 2025-02-10 18:55:01

cocescefunction(“ 返回第一个在字段列表中找到的非损坏值)可用于处理nullcompany> Company月中的值值字段:

1)公司Colesce

  •   cocce(公司(表1),公司(表2))
     
  • 类型 :文本

2)

  •   colesce(月(表1),月份(表2))
     
  • 类型 :date&gt;年度

=“ 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 the NULL values in both the Company and Month fields:

1) Company COALESCE

  • COALESCE(Company (Table 1), Company (Table 2))
    
  • Type: Text

2) Month COALESCE

  • COALESCE(Month (Table 1), Month (Table 2))
    
  • Type: Date > Year Month

Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:

4

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文