Skip to content

Commit

Permalink
[dbt] br_ibge_censo_2022 (#839)
Browse files Browse the repository at this point in the history
* add setor_censitario, fix: municipio, fix: alfabetizaca

* add extra files
  • Loading branch information
laura-l-amaral authored Nov 28, 2024
1 parent 625d86e commit 2e069c3
Show file tree
Hide file tree
Showing 16 changed files with 5,990 additions and 509 deletions.
818 changes: 409 additions & 409 deletions dbt_project.yml

Large diffs are not rendered by default.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
)
}}
select
safe_cast(municipio_codigo_ as string) id_municipio,
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(munic_pio__c_digo_ as string) id_municipio,
safe_cast(cor_ou_ra_a as string) cor_raca,
safe_cast(sexo as string) sexo,
safe_cast(idade as string) grupo_idade,
safe_cast(alfabetizacao as string) alfabetizacao,
safe_cast(alfabetiza__o as string) alfabetizacao,
safe_cast(valor as int64) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.alfabetizacao_grupo_idade_sexo_raca`
Expand Down
4 changes: 2 additions & 2 deletions models/br_ibge_censo_2022/br_ibge_censo_2022__municipio.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ with
alfabetizacao as (
select
2022 as ano,
safe_cast(municipio_codigo_ as string) id_municipio,
safe_cast(munic_pio__c_digo_ as string) id_municipio,
round(
sum(if(alfabetizacao = 'Alfabetizadas', safe_cast(valor as int64), 0))
sum(if(alfabetiza__o = 'Alfabetizadas', safe_cast(valor as int64), 0))
/ sum(safe_cast(valor as int64)),
5
) as taxa_alfabetizacao
Expand Down
Loading

0 comments on commit 2e069c3

Please sign in to comment.