let
Liste = Text.Combine(List.Transform(Excel.CurrentWorkbook(){[Name="Requête2"]}[Content][Requête2], Text.From),","),
Source = Odbc.Query("dsn=lfb2", "SELECT #(lf)#(tab)T1.AV,#(lf)#(tab)T1.NODEP,#(lf)#(tab)T1.TRSDEP,#(lf)#(tab)T1.ZONE,#(lf)#(tab)T1.FORFAI,#(lf)#(tab)T1.TRCDEV,#(lf)#(tab)T1.DAPP,#(lf)#(tab)T3.NLIEUE#(lf)FROM #(lf)#(tab)ROXDTA400.TRTF0010 T1#(lf)#(tab)LEFT OUTER JOIN ROXDONNEE.LIEUENL T3#(lf)#(tab)ON #(lf)#(tab)T1.NODEP = T3.CODGEO#(lf)WHERE #(lf)DAPP IN (" & Liste & ")#(lf)AND AV = 'A'#(lf)#(tab)" ),
#"Colonnes renommées" = Table.RenameColumns(Source,{{"AV", "Achat / Vente"}, {"TRSDEP", "Site 3"}, {"ZONE", "Zone"}, {"FORFAI", "Forfait"}, {"TRCDEV", "Devise"}, {"DAPP", "Date d'application"}, {"NLIEUE", "Code Lieu"}, {"NODEP", "CPT"}})
in
#"Colonnes renommées"