Skip to content
Snippets Groups Projects
Commit 9807ad23 authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[ADD] Adding the remaining filters/dimensions

parent 99ed3712
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!386Merge development -> homologa,!383FIrst deploy of new route 'new_pnad'
......@@ -159,6 +159,76 @@ rqf.addField({
type: 'integer',
field: 'nivel_etapa_modalidade_freq'
}
}).addValue({
name: 'bolsa_familia',
table: 'pnad_novo',
tableField: 'recebeu_rendimentos_de_programa_bolsa_familia',
resultField: 'bolsa_familia',
where: {
relation: '=',
type: 'integer',
field: 'recebeu_rendimentos_de_programa_bolsa_familia'
}
}).addValue({
name: 'race',
table: 'pnad_novo',
tableField: 'cor_raca',
resultField: 'race',
where: {
relation: '=',
type: 'integer',
field: 'cor_raca'
}
}).addValue({
name: 'income_range',
table: 'pnad_novo',
tableField: 'faixa_rendimento',
resultField: 'income_range',
where: {
relation: '=',
type: 'integer',
field: 'faixa_rendimento'
}
}).addValue({
name: 'sex',
table: 'pnad_novo',
tableField: 'sexo',
resultField: 'sex',
where: {
relation: '=',
type: 'integer',
field: 'sexo'
}
}).addValue({
name: 'cap_code',
table: 'pnad_novo',
tableField: 'cod_cap',
resultField: 'cap_code',
where: {
relation: '=',
type: 'integer',
field: 'cod_cap'
}
}).addValue({
name: 'reg_code',
table: 'pnad_novo',
tableField: 'cod_regiao',
resultField: 'reg_code',
where: {
relation: '=',
type: 'integer',
field: 'cod_regiao'
}
}).addValue({
name: 'metro_code',
table: 'pnad_novo',
tableField: 'cod_rm_ride',
resultField: 'metro_code',
where: {
relation: '=',
type: 'integer',
field: 'cod_rm_ride'
}
}).addValue({
name: 'min_year',
table: 'pnad_novo',
......@@ -230,7 +300,7 @@ rqf.addField({
PnadNovoApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.sql.from('pnad_novo')
.field('round(sum(pnad_novo.peso_domicilio_pessoas_com_cal), 0)', 'name')
.field('round(sum(pnad_novo.peso_domicilio_pessoas_com_cal), 0)', 'total')
.field('pnad_novo.ano_ref', 'year')
.group('pnad_novo.ano_ref')
.order('pnad_novo.ano_ref')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment