-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
laurinehu
committed
May 13, 2024
1 parent
400b82b
commit fba4078
Showing
6 changed files
with
66 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
and pass."date_début" > '2021-01-01' | ||
and pass."date_début" < '2023-06-30' | ||
and sorties.date_sortie is not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters