/apps_f.sql Secret
Created
March 22, 2023 17:33
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
{{ | |
config( | |
table_type = "fact", | |
primary_index = ["app"] | |
) | |
}} | |
with logs as ( | |
select * from {{ ref('stg_logs') }} | |
), | |
countries_regions AS ( | |
SELECT | |
* | |
FROM | |
{{ ref('countries_by_region') }} | |
) | |
SELECT country_region, | |
app, | |
year, | |
count(ip_address) as ip_address_count | |
FROM logs | |
LEFT JOIN countries_regions on country==country_code | |
where year >= '{{ var("start_year") }}' | |
group by 1,2,3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment