Skip to content
Snippets Groups Projects
Commit 8e64602d authored by lgtg20's avatar lgtg20
Browse files

feat: faixa de renda showing right results

parent 3fb81f8a
No related branches found
No related tags found
4 merge requests!449Homologa,!444dev -> hom,!440New indicators,!432Issue 953
...@@ -36,5 +36,7 @@ module.exports = function incomeRange(id) { ...@@ -36,5 +36,7 @@ module.exports = function incomeRange(id) {
return 'Mais de 5 salários mínimos'; return 'Mais de 5 salários mínimos';
case 9: case 9:
return 'Não informado ou ignorado'; return 'Não informado ou ignorado';
case 10:
return "Ignorado"
} }
}; };
...@@ -159,7 +159,7 @@ basicEducationConclusion.get('/income_range', (req, res, next) => { ...@@ -159,7 +159,7 @@ basicEducationConclusion.get('/income_range', (req, res, next) => {
id: i, name: id2str.incomeRange(i) id: i, name: id2str.incomeRange(i)
}); });
} }
req.result.push({id: 9, name: id2str.incomeRange(9)}); req.result.push({id: 10, name: id2str.incomeRange(10)});
next(); next();
}, response('income_range')); }, response('income_range'));
...@@ -426,12 +426,12 @@ rqf.addField({ ...@@ -426,12 +426,12 @@ rqf.addField({
}).addValue({ }).addValue({
name: 'income_range', name: 'income_range',
table: 'pnad_novo', table: 'pnad_novo',
tableField: 'faixa_rendimento_aux', tableField: 'faixa_rendimento_aux_tx',
resultField: 'income_range_id', resultField: 'income_range_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'faixa_rendimento_aux' field: 'faixa_rendimento_aux_tx'
} }
}).addValue({ }).addValue({
name: 'gender', name: 'gender',
...@@ -599,8 +599,14 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) => ...@@ -599,8 +599,14 @@ basicEducationConclusion.get('/', rqf.parse(), rqf.build(), (req, res, next) =>
.group("ano_ref") .group("ano_ref")
.order("ano_ref"); .order("ano_ref");
if (req.query.dims && req.query.dims.includes("income_range")) {
totalPopMaior19.where("faixa_rendimento_aux_tx is not null");
totalPopEdBasMaior19.where("faixa_rendimento_aux_tx is not null");
}
req.querySet.push(totalPopEdBasMaior19); req.querySet.push(totalPopEdBasMaior19);
req.querySet.push(totalPopMaior19); req.querySet.push(totalPopMaior19);
next(); next();
}, multiQuery, (req, res, next) => { }, multiQuery, (req, res, next) => {
// The multiple requests are made. Then we need to calculate the percetange. So the function // The multiple requests are made. Then we need to calculate the percetange. So the function
......
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