Google Data Studio 中的 COUNTIFS 函数

Nik*_*RLA 4 google-data-studio

我有 2 列称为大洲和完成度,我想根据以下数据计算每个大洲的完成度百分比。这是在 excel 中使用 COUNTIFS() 函数定义的

我们可以在数据工作室中实现这个吗??

完成百分比公式是“关闭”状态的总数/状态值的总数 状态值是“打开”、“进行中”、“服务完成”、“关闭”

continent          completion %         

------------     -------------------       

Asia                  97%(used countifs function to calculate percentage in excel)
Europe                89%              
North America         93%      
Run Code Online (Sandbox Code Playgroud)

Dak*_*ker 14

据我了解,您将需要一个名为“Closed”的新字段,该代码应如下所示:

CASE 
   WHEN [Whatever your status field name is] = 'closed' THEN 1
   ELSE 0
END
Run Code Online (Sandbox Code Playgroud)

然后你将不得不在另一个名为“Total closed”的新字段中使用它,它应该如下所示:

SUM(CASE 
      WHEN Closed = 1 THEN 1
      ELSE 0
    END)
Run Code Online (Sandbox Code Playgroud)

然后从那里您可以创建“完成%”:

Total closed / COUNT([Your status field])
Run Code Online (Sandbox Code Playgroud)

这是一个可能有用的谷歌论坛问题的链接