Skip to content

Instantly share code, notes, and snippets.

@aoxu
Last active November 19, 2018 09:00
Show Gist options
  • Save aoxu/10049e892ae8026410e16156f3137936 to your computer and use it in GitHub Desktop.
Save aoxu/10049e892ae8026410e16156f3137936 to your computer and use it in GitHub Desktop.
[查询注册用户在指定日期范围内的IAP数据] #BigQuery
SELECT
user_id, event_params.value.int_value/1000000 as price_in_usd, event_value_in_usd as exchanged_revenue_in_usd
FROM
`analytics_168921341.events_*` AS T,
T.event_params
WHERE
event_name = 'in_app_purchase'
AND event_params.key = 'value'
/* AND event_params.value.int_value = 51 */
AND _TABLE_SUFFIX BETWEEN '20181117' AND '20181118' /* 修改为付费日期范围 */
AND user_id IN (
SELECT
DISTINCT user_id
FROM
`analytics_168921341.events_*` AS T,
T.event_params
WHERE
event_name = 'sign_up'
AND geo.country = 'United States' /* 修改为指定国家 */
AND platform = 'IOS'
AND _TABLE_SUFFIX BETWEEN '20181117' AND '20181117' /* 修改为注册日期范围 */
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment