-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nouveau calcul des recrutements #175
Conversation
ToDo : ajout des propriétés structures (localisation etc) et salarié (genre etc) pour permettre le branchement des filtres |
7c57ee0
to
6cfd832
Compare
@@ -71,7 +71,7 @@ models: | |||
Vue créée pour joindre les dates d'embauche de chaque candidat. Cette vue est utilisée dans candidats_derniere_embauche.sql pour extraire la dernière date d'embauche d'un candidat. | |||
- name: stg_salarie | |||
description: > | |||
Vue créée pour récupérer les id uniques des salarié(e)s ainsi que leur genre afin de permettre le calcul des ETPs par genre. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'aurais du rajouter un test qui compare le nombre de lignes de stg_salarie
et salaries_V2
. Est ce quetu pourras le faire stp ? :)
d462ee7
to
7aca442
Compare
dbt/models/marts/recrutements.sql
Outdated
end as salarie_brsa, | ||
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree, | ||
date_trunc('month', to_date(ctr.contrat_date_embauche, 'DD/MM/YYYY')) as mois_entree | ||
from {{ source('fluxIAE', 'fluxIAE_ContratMission') }} as ctr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attention ici tu as pas pris le contrat V2 dans indexed
dbt/models/marts/recrutements.sql
Outdated
when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI' | ||
else 'NON' | ||
end as salarie_brsa, | ||
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ici je te conseille d'utiliser le seed ref_mesure_dispositif_asp.csv
pour choper au passage le type de structure des emplois, ptet ça servira un jour
dbt/models/marts/recrutements.sql
Outdated
struct.structure_denomination, | ||
struct.structure_adresse_admin_commune, | ||
struct.structure_adresse_admin_code_insee, | ||
app_geo.code_dept as departement_structure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi tu ne prends pas directement le nom_departement de la colonne nom_departement de la table fluxIAE_Structure_v2 ? (pareil pour la région)
dbt/models/marts/recrutements.sql
Outdated
on ctr.contrat_id_pph = salarie.salarie_id | ||
left join {{ source('fluxIAE', 'fluxIAE_RefNiveauFormation') }} as rnf | ||
on ctr.contrat_niveau_de_formation_code = rnf.rnf_id | ||
left join {{ source('fluxIAE', 'fluxIAE_Structure') }} as struct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prends autant que possible versions indexed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Globalement ok, tu peux utiliser ça pour comparer les chiffres que tu obtiens avec ceux d'Elodie
Mais il manque/il faut modifier des colonnes (localisation en fonction de l'AF, colonnes localisation) et qques petits ajouts
b5de119
to
d5c2e23
Compare
) }} | ||
|
||
select | ||
/* l'ASP préconise l'utilisation de l'adresse administrative pour récupérer la commune de la structure */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu as bien vérifié que ça donne la même chose que l'ancienne version ?
dbt/models/indexed/recrutements.sql
Outdated
{'columns': ['contrat_id_ctr', 'contrat_id_pph'], 'type' : 'btree', 'unique' : False}, | ||
] | ||
) }} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ici je pense pas que tu sois obligée de faire des index vu que tu t'en sers nulle part pour des jointures.
TU peux la déplacer dans marts selon moi :)
dbt/models/indexed/recrutements.sql
Outdated
when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI' | ||
else 'NON' | ||
end as salarie_brsa, | ||
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu préfères faire ça que la jointure avec le seed ref_mesure_dispositif_asp.csv
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops non oubli merci !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qques petits points a corriger selon moi mais ça me semble ok
5edbdc6
to
79bf88c
Compare
f7e9157
to
4c3b02a
Compare
**Carte Notion : ** https://www.notion.so/plateforme-inclusion/TB118-ReCr-er-des-indicateurs-recrutements-tels-que-d-finis-dans-l-ancien-TB-donn-es-de-l-IAE-e2b6a58266594154b976b59e5651a157?pvs=4
Pourquoi ?
Nouveau mode de calcul des recrutements en suivant les règles de calcul de l'ASP
Checks