如何在 Google Data Studio 中用新行连接两个字段?

How to concat two fields with a new line in the middle in Google Data Studio?

首先,这 How to make a new line in Google Data Studio in the exception? 不同,因为后者用于编写新的连接器,而我并没有尝试这样做。

我想在 table 列中连接两个字段并在中间换行。使用 \n 似乎不起作用。

我已经构建了这样的计算字段:

concat([Field1],"\n","\n",[Field2])

在 table:

Field 1

Field 2

出于某种原因,当使用自定义数据源连接换行符时,在我执行的任何测试下都不起作用(我使用了它们 have 的每个文本操作函数)。与 Kellie 的回答相符的方法是:

concat(field1, '\n\n', field2)

这仅适用于没有日期范围维度的 google 分析数据源(我没有测试 gsheets/others)并且您必须在 table 主体已启用。我发现 work-around *不使用数据工作室格式,因为您可以将其放入数据连接器 query/stored 过程中。一个 PostgreSQL 示例:

select 
concat(field1, e'\n\n', field2) as newfield
from datatable;

希望 datastudio 团队将来会修复此错误(编辑:此错误与 pivot tables 有关,因为他们无法识别新行)。