- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Firebase 通过 Firebase 远程配置提供拆分测试功能,但无法过滤具有用户属性(实际上具有任何属性)的同类群组部分中的保留。
为了寻求这个问题的解决方案,我正在寻找 BigQuery,因为 Firebase Analytics 提供了将数据导出到该服务的可用方法。
但是我遇到了很多问题,谷歌没有答案或例子可以指出我正确的方向。
一般问题:
作为第一步,我需要聚合代表相同数据 firebase 队列的数据,所以我可以确定我的计算是正确的:
下一步应该只是对查询应用约束,以便它们匹配自定义用户属性。
到目前为止,我得到了什么:
主要问题 - 用户计算的巨大差异。有时大约有 100 个用户,但有时接近 1000 个。
这是我使用的方法:
# 1
# Count users with `user_dim.first_open_timestamp_micros`
# in specified period (w0 – week 1)
# this is the way firebase group users to cohorts
# (who started app on the same day or during the same week)
# https://support.google.com/firebase/answer/6317510
SELECT
COUNT(DISTINCT user_dim.app_info.app_instance_id) as count
FROM
(
TABLE_DATE_RANGE
(
[admob-app-id-xx:xx_IOS.app_events_],
TIMESTAMP('2016-11-20'),
TIMESTAMP('2016-11-26')
)
)
WHERE
STRFTIME_UTC_USEC(user_dim.first_open_timestamp_micros, '%Y-%m-%d')
BETWEEN '2016-11-20' AND '2016-11-26'
# 2
# For each next period count events with
# same first_open_timestamp
# Here is example for one of the weeks.
# week 0 is Nov20-Nov26, week 1 is Nov27-Dec03
SELECT
COUNT(DISTINCT user_dim.app_info.app_instance_id) as count
FROM
(
TABLE_DATE_RANGE
(
[admob-app-id-xx:xx_IOS.app_events_],
TIMESTAMP('2016-11-27'),
TIMESTAMP('2016-12-03')
)
)
WHERE
STRFTIME_UTC_USEC(user_dim.first_open_timestamp_micros, '%Y-%m-%d')
BETWEEN '2016-11-20' AND '2016-11-26'
# 3
# Now we have users for each week w1, w2, ... w5
# Calculate retention for each of them
# retention week 1 = w1 / w0 * 100 = 25.72181359
# rw2 = w2 / w1 * 100
# ...
# rw5 = w5 / w1 * 100
# 4
# Shift week 0 by one and repeat from step 1
user_dim.device_info.device_id
和 user_dim.device_info.resettable_device_id
是 null
? user_dim.app_info.app_id
文档中缺少(如果 Firebase 支持队友会阅读此问题)event_dim.timestamp_micros
和 event_dim.previous_timestamp_micros
应该使用,我无法达到他们的目的。 最佳答案
Any tips and directions to go about building complex query which may aggregate and calculate all data required for this task in one step is very appreciated.
yes, generic bigquery will work fine
#standardSQL
WITH activities AS (
SELECT answers.owner_user_id AS id,
FORMAT_DATE('%Y-%m', DATE(answers.creation_date)) AS period
FROM `bigquery-public-data.stackoverflow.posts_answers` AS answers
JOIN `bigquery-public-data.stackoverflow.posts_questions` AS questions
ON questions.id = answers.parent_id
WHERE CONCAT('|', questions.tags, '|') LIKE '%|google-bigquery|%'
GROUP BY id, period
), cohorts AS (
SELECT id, MIN(period) AS cohort FROM activities GROUP BY id
), periods AS (
SELECT period, ROW_NUMBER() OVER(ORDER BY period) AS num
FROM (SELECT DISTINCT cohort AS period FROM cohorts)
), cohorts_size AS (
SELECT cohort, periods.num AS num, COUNT(DISTINCT activities.id) AS ids
FROM cohorts JOIN activities ON activities.period = cohorts.cohort AND cohorts.id = activities.id
JOIN periods ON periods.period = cohorts.cohort
GROUP BY cohort, num
), retention AS (
SELECT cohort, activities.period AS period, periods.num AS num, COUNT(DISTINCT cohorts.id) AS ids
FROM periods JOIN activities ON activities.period = periods.period
JOIN cohorts ON cohorts.id = activities.id
GROUP BY cohort, period, num
)
SELECT
CONCAT(cohorts_size.cohort, ' - ', FORMAT("%'d", cohorts_size.ids), ' users') AS cohort,
retention.num - cohorts_size.num AS period_lag,
retention.period as period_label,
ROUND(retention.ids / cohorts_size.ids * 100, 2) AS retention , retention.ids AS rids
FROM retention
JOIN cohorts_size ON cohorts_size.cohort = retention.cohort
WHERE cohorts_size.cohort >= FORMAT_DATE('%Y-%m', DATE('2015-01-01'))
ORDER BY cohort, period_lag, period_label
关于Firebase 导出到 BigQuery : retention cohorts query,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41509431/
我有一个包含数据的表,其中在 A 列中我有一组重复的数据(一个接一个)。 我只想根据 A 列中的值(没有其他条件)选择每个组的第一行。请注意,我还希望为提到的新发现的行选择所有相应的列(我不想排除它们
我有一个包含 340GB 数据的表,但我们只使用了最后一周的数据。因此,为了最小化将这些数据移动到分区表或分片表的成本计划。 我对分片表和分区做了一些实验。我创建了分区表并加载了两天的数据(两个分区)
我想安排将数据从 GCS 存储桶加载到 BigQuery 表。如果我使用 bigquery-transfer 与调度及时的 bigquery-loads 的核心区别是什么? 最佳答案 它们是相同的。
我想安排将数据从 GCS 存储桶加载到 BigQuery 表。如果我使用 bigquery-transfer 与调度及时的 bigquery-loads 的核心区别是什么? 最佳答案 它们是相同的。
我想编写一个 BigQuery 命令行命令来检索 BigQuery 表的最后修改时间。我怎样才能做到这一点? 仅当 BigQuery 表的最后修改日期时间大于某个日期时间时,我才会使用它。 最佳答案
我似乎无法将任何数据从 Socrata 上传到 BigQuery。我收到“加载操作中的 BigQuery 错误:无法连接 BigQuery 服务器。”最初我得到的是 0 错误错误的限制。现在我已将 C
我正在尝试弄清楚是否可以从大查询中导出 hyperloglog 草图并在外部合并它们以进行基数估计。是否有可用的开源库可以轻松解析大型查询草图? 如果不是,是否有任何关于 biq 查询的 hyperl
这是我用作https://cloud.google.com/bigquery/docs/managing-tables#bigquery-copy-table-python的引用的代码: source
构建管道时,源是 BigQueryIO.Read,您会得到一组 TableRow 对象以供使用。 我基本上想对那些 TableRow 对象进行一些小的更改,然后使用 BigQueryIO.Write
BigQuery API Client Libraries 之间有什么区别?和 BigQuery Storage API Client Libraries ? 在 BigQuery Storage R
据我所知,将数据流式传输到 BigQuery 会导致重复行,正如这里提到的 https://cloud.google.com/bigquery/streaming-data-into-bigquery
我在 BigQuery Jobs API 中注意到复制任务: https://developers.google.com/bigquery/docs/reference/v2/jobs#resourc
https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/ 我正在寻找“bigquery 数据传输服务”的 php 客户端库
我正在从 GCS 中的 CSV 文件到 BQ 执行一些 ETL,一切正常,除了日期。我的表中的字段名称是 TEST_TIME,类型是 DATE,所以在 TableRow 中我尝试传递一个 java.u
我已经阅读了 BigQuery 连接器的文档(https://support.google.com/360suite/datastudio/answer/6370296?hl=en)。 我想将自定义查
当两个不同的billing account下有两个project,并且有跨两个project的授权view时,view的查询费用由哪个billing account来计费? 场景:项目 A 包含使用项
所以我有一张购买表: 用户编号 购买时间 数量 我有一张网站上的用户事件表: 用户编号 位置 浏览时间 如何在不超过 purchase_time 的情况下将 purchases 表与 activiti
我有一个 unix 时间戳列,在我的 csv 文件中以毫秒表示。现在,当我将这些数据插入到我的 bigQuery 表中并查询它时,我得到了这个错误 bigQuery not supporting mi
我目前正在将 BigQuery 表提取到 Google Cloud Storage 中的分片 .csv 中——是否有任何方法可以对提取的行进行洗牌/随机化? GCS .csv 将用作 GCMLE 模型
我需要从数据流更新和删除 BigQuery 中的记录。数据来自 Pubsub,并带有标识操作插入、更新、删除 (I、U、D) 的标志。插入不是问题。 有更新和删除的建议吗? 最佳答案 Dataflow
我是一名优秀的程序员,十分优秀!