Skip to content

Commit

Permalink
Merge pull request #343 from basedosdados/staging/br_ibge_pnadc-rendi…
Browse files Browse the repository at this point in the history
…mentos_outras_fontes

[fix] br_ibge_pnadc__microdados
  • Loading branch information
vilelaluiza authored Oct 25, 2023
2 parents 295f73a + 821aa49 commit 4eeb65e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions models/br_ibge_pnadc/br_ibge_pnadc__microdados.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
labels = {'project_id': 'basedosdados-dev', 'tema': 'economia'})
}}

SELECT
SELECT
SAFE_CAST(ano AS INT64) ano,
SAFE_CAST(trimestre AS INT64) trimestre,
SAFE_CAST(id_uf AS STRING) id_uf,
Expand All @@ -23,9 +23,10 @@ SAFE_CAST(capital AS STRING) capital,
SAFE_CAST(rm_ride AS STRING) rm_ride,
SAFE_CAST(id_upa AS STRING) id_upa,
SAFE_CAST(id_estrato AS STRING) id_estrato,
SAFE_CAST(id_domicilio AS STRING) id_domicilio,
SAFE_CAST(V1008 AS INT64) V1008,
SAFE_CAST(V1014 AS INT64) V1014,
SAFE_CAST(CONCAT(id_upa,lpad(V1008,2,'0'),lpad(V1014,2,'0')) AS STRING) id_domicilio,
SAFE_CAST(CONCAT(id_upa,lpad(V1008,2,'0'),lpad(V1014,2,'0'), lpad(V2003,2,'0')) AS STRING) id_pessoa,
SAFE_CAST(lpad(V1008,2,'0') AS STRING) V1008,
SAFE_CAST(lpad(V1014,2,'0') AS STRING) V1014,
SAFE_CAST(V1016 AS INT64) V1016,
SAFE_CAST(V1022 AS STRING) V1022,
SAFE_CAST(V1023 AS STRING) V1023,
Expand Down
2 changes: 2 additions & 0 deletions models/br_ibge_pnadc/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ models:
description: ID Estrato (As 2 primeiras posições representam o código da Unidade da Federação)
- name: id_domicilio
description: ID Domicílio
- name: id_pessoa
description: ID Pessoa Entrevistada
- name: V1008
description: Número de seleção do domicílio
- name: V1014
Expand Down

0 comments on commit 4eeb65e

Please sign in to comment.