Skip to content

Commit

Permalink
add candidates that are not followed by ft
Browse files Browse the repository at this point in the history
  • Loading branch information
laurinehu committed Apr 19, 2024
1 parent b9855a7 commit 3eaf697
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dbt/models/marts/oneshot/ft_candidats_non_ft_sorties.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
select
salarie.salarie_id,
sorties.date_sortie
from "fluxIAE_Salarie" as salarie
-- pour récupérer le nir pour ensuite pouvoir filtrer les candidats non ft
left join "pass_agréments" as pass
on salarie."hash_numéro_pass_iae" = pass."hash_numéro_pass_iae"
left join candidats as c
on c.id = pass.id_candidat
-- pour filtrer les candidats non ft
left join ft_candidats_nord as ft_candidates
on ft_candidates.nir_hash = c.hash_nir
-- ici on croise avec les contrats pour récup la sortie
left join "sorties_definitives" as sorties
on sorties.contrat_id_pph = salarie.salarie_id
-- 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.salarie_code_dpt = '059'
and pass.date_début > '2021-01-01'
and pass.date_début < '2023-06-30'
and c.hash_nir is null

0 comments on commit 3eaf697

Please sign in to comment.