【问题标题】:Google Data Studio custom metric multiplying 2 parametersGoogle Data Studio 自定义指标乘以 2 个参数
【发布时间】:2017-07-13 13:49:51
【问题描述】:

我正在使用 Firebase 从我的应用程序中收集事件。

例如,假设我有一个事件 print_attempt,它有 2 个参数 page_count 和copies。像这样的..

event {
   name: print_attempt
   param {
     name: copies
     int_value: 10
   }
   param {
     name: page_count
     int_value: 5
   }
 }

现在在 Google Data Studio 中,我想打印一个公制的总页数。如何将 2 个参数值相乘?

SUM(CASE WHEN Event Param Name = "page_count" THEN Event Param Value Int ELSE 0 END)

返回 page_count 的总和,但在这种情况下,副本值被忽略。

我尝试跟随,但这给了我错误。

SUM(CASE 
      WHEN Event Param Name = "page_count" THEN (
              Event Param Value Int * CASE WHEN EVENT PARAM NAME ="copies" THEN 
              Event Param Value Int ELSE 1 END) 
      ELSE 0 END)

任何指针?

【问题讨论】:

    标签: sql firebase metrics firebase-analytics google-data-studio


    【解决方案1】:

    我从here得到了答案。

    这是不可能的,因为连接器使用扁平架构,其中我试图相乘的 int 值将位于不同的记录中。

    我最终在事件 ex 中添加了另一个 int 参数。值为 page_count*copies 的 total_pages。

    其他解决方案可能是创建一个视图或表格,其中 page_count 和副本作为一行的单独列。

    【讨论】:

      猜你喜欢
      • 2021-10-29
      • 1970-01-01
      • 2018-03-21
      • 1970-01-01
      • 2020-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      相关资源
      最近更新 更多