-
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
sorties pour ft #281
base: main
Are you sure you want to change the base?
sorties pour ft #281
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
select | ||
salarie_asp."hash_numéro_pass_iae" as "hash_numéro_pass_iae", | ||
salarie_asp.salarie_id as id_salarie_asp, | ||
candidat_emploi.id as id_candidat_emplois, | ||
candidat_emploi.hash_nir as hash_nir | ||
from {{ source('fluxIAE', 'fluxIAE_Salarie') }} as salarie_asp | ||
left join {{ source('emplois', 'pass_agréments') }} as pass | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attention dans la table pass agréments il y a des doublons, peut etre que ça vaudrait le coup de les retirer |
||
on salarie_asp."hash_numéro_pass_iae" = pass."hash_numéro_pass_iae" | ||
left join {{ ref('candidats') }} as candidat_emploi | ||
on candidat_emploi.id = pass.id_candidat |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
select | ||
emi.emi_pph_id as pph_id, | ||
emi.emi_ctr_id as ctr_id, | ||
emi.emi_date_fin_reelle as date_fin_reelle, | ||
rms.rms_libelle as motif_de_sortie | ||
from {{ ref("fluxIAE_EtatMensuelIndiv_v2") }} as emi | ||
left join {{ ref("fluxIAE_RefMotifSort_v2") }} as rms | ||
on emi.emi_motif_sortie_id = rms.rms_id | ||
where emi.emi_date_fin_reelle is not null | ||
group by | ||
emi.emi_pph_id, | ||
emi.emi_ctr_id, | ||
emi.emi_date_fin_reelle, | ||
emi.emi_motif_sortie_id, | ||
rms.rms_libelle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
select | ||
ctr.contrat_id_pph, | ||
ctr.contrat_id_structure, | ||
ref_mesure.type_structure_emplois as type_structure, | ||
max(ctr.contrat_date_sortie_definitive) as date_sortie | ||
-- array_agg(motif_sortie.rms_libelle) as motifs_sortie | ||
from {{ ref('fluxIAE_ContratMission_v2') }} as ctr | ||
left join {{ ref('ref_mesure_dispositif_asp') }} as ref_mesure | ||
on ref_mesure.af_mesure_dispositif_code = ctr.contrat_mesure_disp_code | ||
where ctr.contrat_date_sortie_definitive is not null | ||
group by | ||
ctr.contrat_id_pph, | ||
ctr.contrat_id_structure, | ||
ref_mesure.type_structure_emplois |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
select | ||
candidats.hash_nir as nir_emplois, | ||
ft_candidats.nir_hash as nir_ft, | ||
candidats.id_candidat_emplois as id_candidat_emplois, | ||
candidats.id_salarie_asp as id_salarie_asp, | ||
sorties.date_sortie, | ||
sorties.type_structure, | ||
msct.motif_de_sortie | ||
from {{ ref('candidats_pk') }} as candidats | ||
left join {{ ref('fluxIAE_Salarie_v2') }} as salarie_asp | ||
on salarie_asp.salarie_id = candidats.id_salarie_asp | ||
left join {{ source('emplois', 'pass_agréments') }} as pass | ||
on pass."hash_numéro_pass_iae" = candidats."hash_numéro_pass_iae" | ||
-- pour filtrer les candidats non ft | ||
left join {{ ref('ft_candidats_nord') }} as ft_candidats | ||
on ft_candidats.nir_hash = candidats.hash_nir | ||
-- pour récupérer la sortie | ||
left join {{ ref('sorties_definitives') }} as sorties | ||
on sorties.contrat_id_pph = candidats.id_salarie_asp | ||
-- pour récupérer le motif de sortie | ||
left join {{ ref('motif_sortie_contrat_termine') }} as msct | ||
on sorties.contrat_id_pph = msct.pph_id and sorties.date_sortie = msct.date_fin_reelle | ||
-- on ne garde que les candidats : | ||
-- - du nord | ||
-- - un pass IAE a été attribué entre le 1 janvier 2021 et le 30 juin 2023. | ||
where | ||
salarie_asp.salarie_code_dpt = '059' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flute je viens de voir ça... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oopsie... zut je vais voir avec aurélie merci j'y avais pas pensé |
||
and pass."date_début" > '2021-01-01' | ||
and pass."date_début" < '2023-06-30' | ||
and sorties.date_sortie is not null |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
select | ||
candidats.hash_nir as nir_emplois, | ||
ft_candidats.nir_hash as nir_ft, | ||
candidats.id_candidat_emplois as id_candidat_emplois, | ||
candidats.id_salarie_asp as id_salarie_asp, | ||
sorties.date_sortie, | ||
sorties.type_structure, | ||
msct.motif_de_sortie | ||
from {{ source('oneshot', 'ft_iae_nord') }} as ft_candidats | ||
left join {{ ref('candidats_pk') }} as candidats | ||
on candidats.hash_nir = ft_candidats.nir_hash | ||
-- ici on croise avec les sorties définitives | ||
-- duplication des candidats parceque certains candidats ont plusieurs sorties | ||
left join {{ ref('sorties_definitives') }} as sorties | ||
on sorties.contrat_id_pph = candidats.id_salarie_asp | ||
-- pour récupérer le motif de sortie | ||
left join {{ ref('motif_sortie_contrat_termine') }} as msct | ||
on sorties.contrat_id_pph = msct.pph_id and sorties.date_sortie = msct.date_fin_reelle |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
select | ||
ft.id_salarie_asp, | ||
ft.id_salarie_emplois, | ||
ft.date_sortie, | ||
ft.type_structure, | ||
ft.motif_de_sortie, | ||
nir_corresp.nir, | ||
case when nir_hash is not null then 'oui' else 'non' end as ft | ||
from {{ ref("xpnord_sorties_candidats_ft") }} as ft | ||
left join {{ ref("nir_corresp") }} as nir_corresp | ||
on nir_corresp.hash_nir = ft.nir_ft | ||
where ft.date_sortie is not null | ||
union | ||
select | ||
ft.id_salarie_asp, | ||
ft.id_salarie_emplois, | ||
ft.date_sortie, | ||
ft.type_structure, | ||
ft.motif_de_sortie, | ||
nir_corresp.nir | ||
case when nir_hash is not null then 'oui' else 'non' end as ft | ||
from {{ ref("xpnord_sorties_candidats_asp") }} as ft | ||
left join {{ ref("nir_corresp") }} as nir_corresp | ||
on nir_corresp.hash_nir = ft.nir_emplois | ||
where ft.date_sortie is not null |
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.
candidats pk ? Candidats parce que mdrrrrr
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.
Quand je quitterai le gip j'espere que mon futur employeur ira voir mes commentaires de PR avant de m'embaucher
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.
😭😭😭 que de rigolades entre les pk et les fdp