Last active
September 2, 2022 20:29
-
-
Save Zmey56/f9d343214e669a79e8ed78bcc0fdb97b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_dau_all_q = """select date, | |
uniqExact(user_id) as users, | |
uniqExactIf(user_id, os='iOS') as users_ios, | |
uniqExactIf(user_id, os='Android') as users_and, | |
uniqExactIf(user_id, gender=1) as users_male, | |
uniqExactIf(user_id, gender=0) as users_female | |
from | |
(select distinct toDate(time) as date, user_id, os, gender | |
from simulator_20220620.feed_actions | |
where toDate(time) between today() - 8 and today() - 1 | |
union all | |
select distinct toDate(time) as date, user_id, os, gender | |
from simulator_20220620.message_actions | |
where toDate(time) between today() - 8 and today() - 1) as t | |
group by date | |
order by date""" | |
data_dau_all = pd.DataFrame(ph.read_clickhouse(query=query_dau_all_q, connection=connection)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment