1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| let
Source = Excel.CurrentWorkbook(){[Name="Depart1"]}[Content],
#"Autres colonnes supprimées" = Table.SelectColumns(Source,{"Nom", "Club", "Catégorie", "Score", "10+", "10", "9", "Code"}),
#"Lignes filtrées" = Table.SelectRows(#"Autres colonnes supprimées", each ([Nom] <> "" and [Nom] <> " ")),
#"Regroupement par catégorie" = Table.Group(#"Lignes filtrées", {"Catégorie"}, {{"Partition", each Table.AddIndexColumn(_,"Index",1,1), type table}}),
Personnalisé1 = Table.AddColumn(#"Regroupement par catégorie", "P1", each Table.AddIndexColumn(Table.Sort([Partition],{{"Score",Order.Descending}}),"Rang",1,1)),
#"P1 développé" = Table.ExpandTableColumn(Personnalisé1, "P1", {"Nom", "Club", "Score", "10+", "10", "9", "Code", "Index", "Rang"}, {"Nom", "Club", "Score", "10+", "10", "9", "Code", "Index", "Rang"}),
#"Colonnes supprimées" = Table.RemoveColumns(#"P1 développé",{"Partition"}),
#"Requête ajoutée" = Table.Combine({#"Colonnes supprimées", Catégories}),
#"Lignes triées1" = Table.Sort(#"Requête ajoutée",{{"Code", Order.Ascending}, {"Rang", Order.Ascending}}),
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Lignes triées1", "Catégorie ", each if [Rang] = 0 then [Catégorie] else null),
#"Colonnes permutées" = Table.ReorderColumns(#"Colonne conditionnelle ajoutée",{"Catégorie ", "Catégorie", "Nom", "Club", "Score", "10+", "10", "9", "Code", "Index", "Rang"}),
#"Autres colonnes supprimées1" = Table.SelectColumns(#"Colonnes permutées",{"Catégorie ", "Nom", "Club", "Score", "10+", "10", "9", "Rang"}),
#"Type modifié" = Table.TransformColumnTypes(#"Autres colonnes supprimées1",{{"Catégorie ", type text}, {"Nom", type text}, {"Club", type text}, {"Score", Int64.Type}, {"10+", Int64.Type}, {"10", Int64.Type}, {"9", Int64.Type}, {"Rang", Int64.Type}})
in
#"Type modifié" |
Partager