Created
March 17, 2014 23:39
-
-
Save harleyholt/9610681 to your computer and use it in GitHub Desktop.
Retrieves the data we want to get from RedShift.
This file contains hidden or 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
select | |
row_type_cd, | |
row_sub_type_cd, | |
date_pst, | |
publisher_id, | |
site_id, | |
case | |
when user_type_cd = 'C' then 'control' | |
when user_type_cd = 'T' then 'test' | |
else 'other' | |
end as user_type, | |
is_registered_user_flg, | |
'X' as is_new_registered_user_flg, | |
sum(value) as value, | |
max(dw_cycle_id) as dw_cycle_id | |
from | |
dw_prod_dm.rpt_levr_daily_pst | |
where | |
date_pst = '2014-02-18' | |
and row_type_cd in ('mau', 'dau') | |
group by | |
date_pst, | |
row_type_cd, | |
row_sub_type_cd, | |
publisher_id, | |
site_id, | |
user_type, | |
is_registered_user_flg, | |
is_new_registered_user_flg | |
order by | |
date_pst, | |
row_type_cd, | |
row_sub_type_cd, | |
publisher_id, | |
site_id, | |
user_type, | |
is_registered_user_flg, | |
is_new_registered_user_flg | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment