【问题标题】:How would I count how many events have a certain list item present in Keen IO?我如何计算 Keen IO 中存在某个列表项的事件数?
【发布时间】:2017-08-16 23:00:27
【问题描述】:

假设我的活动看起来像:

purchase = {
   items: ["pickle", "turtle", "lexicon"]
}

我如何计算有多少事件有“pickle”?

【问题讨论】:

    标签: analytics keen-io bigdata


    【解决方案1】:

    使用equal 运算符。

    var count = new Keen.Query("count", {
      event_collection: "purchases",
      timeframe: "this_14_days",
      filters: [
        {
          property_name: "items",
          operator: "eq",
          property_value: "pickle"
        }
      ]
    });
    

    来自API reference for filters & their operators

    “等于”——请注意,如果您的属性值是一个数组,则“eq”可用于过滤该数组中的值。例如,eq: 5 将匹配 [5, 6, 7] 的值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-02
      • 2018-12-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多