如何在Google Data Studio中划分两个参数?

时间:2020-11-03 07:02:24

标签: google-data-studio

我想获取满足条件的实例数,即COUNT_DISTINCT(current_step = 1),然后将结果除以我的数据集中的用户总数,即COUNT_DISTINCT(user_email)

为便于参考,请使用Excel等效项(假设A列为user_email,B列为current_step

=COUNTIF(B:B,1)/COUNTA(A:A)

1 个答案:

答案 0 :(得分:1)

基于问题中的COUNTIF公式:

=COUNTIF(B:B,1)/COUNTA(A:A)

其他#1(基于上述公式) OR #2(使用COUNT_DISTINCT(user_email)作为分母而不是COUNT(user_email))诀窍:

1)分母:COUNT(user_email)

COUNT(CASE current_step
    WHEN 1 THEN current_step
    ELSE NULL
  END ) / COUNT(user_email)

2)分母:COUNT_DISTINCT(user_email)

COUNT(CASE current_step
    WHEN 1 THEN current_step
    ELSE NULL
  END ) / COUNT_DISTINCT(user_email)

Google Data Studio Report和要详细说明的GIF: