let
Bron = Csv.Document(File.Contents("\\SHARE-SQL\bic_tmp_export_rooster 20200614_0610.csv"),[Delimiter=";", Columns=35, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Headers met verhoogd niveau" = Table.PromoteHeaders(Bron, [PromoteAllScalars=true]),
#"Type gewijzigd" = Table.TransformColumnTypes(#"Headers met verhoogd niveau",{{"Personeelsnummer", Int64.Type}, {"Contractnummer", Int64.Type}, {"Naam_Medewerker", type text}, {"Datum", type datetime}, {"Begintijd", type time}, {"Eindtijd", type time}, {"BeginDatumTijd", type datetime}, {"EindDatumTijd", type datetime}, {"Naam_Kostenplaats", type text}, {"Naam_Roostergroep", type text}, {"Activiteit_Type_Sleutel", Int64.Type}, {"Naam_Activiteit_Type", type text}, {"Activiteit_omschrijving", type text}, {"Activiteit_Soort", type text}, {"Duur", Int64.Type}, {"Werktijd", Int64.Type}, {"Arbeidstijd", Int64.Type}, {"ATW_rust", Int64.Type}, {"Rust", Int64.Type}, {"Tijd_aanwezig_op_werk", Int64.Type}, {"Tijd_op_werkplek", Int64.Type}, {"Tijd_ziek", Int64.Type}, {"Tijd_overwerk", Int64.Type}, {"Tijd_verlof", Int64.Type}, {"Tijd_Pauze", Int64.Type}, {"Tijd_standby", Int64.Type}, {"Naam_dienst", type text}, {"Rooster_Status", type text}, {"B4_huidige_func_oms", type text}, {"B4_kpl_een", type text}, {"B4_kpl_twee", type text}, {"B4_kpl_drie", type text}, {"B4_kpl_vier", type text}, {"B4_kpl_vijf", type text}, {"B4_kpl_zes", type text}}),
Afdelingen = Table.SelectRows(#"Type gewijzigd", each ([Naam_Roostergroep] = "Afd A" or [Naam_Roostergroep] = "afd C")),
Jaar = Table.SelectRows(Afdelingen, each [Datum] > #datetime(2019, 12, 31, 23, 59, 0)),
#"Andere kolommen verwijderd" = Table.SelectColumns(Jaar,{"Naam_Medewerker", "Datum", "BeginDatumTijd", "EindDatumTijd", "Naam_Kostenplaats", "Naam_Roostergroep", "Activiteit_Type_Sleutel", "Naam_Activiteit_Type", "Activiteit_omschrijving", "Activiteit_Soort", "Naam_dienst", "Rooster_Status", "B4_huidige_func_oms", "B4_kpl_een", "B4_kpl_twee"})
in
#"Andere kolommen verwijderd"