我在MS excel 2016中有电源查询,我按名称订购数据,但我有重音字母š,č,...现在已经排序到数据集的末尾,但应该是例如š之后的s或č之后C。有可能如何在这里做一些解决方法吗?我想可能会改变编码,但我找不到。
#"Sorted Rows" = Table.Sort(#"Renamed Columns",{{{"Name", Order.Ascending}})
答案 0 :(得分:1)
我能想到的最好的方法是创建一个计算列,您可以在其中替换这些特殊值,然后对该列进行排序。
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each Text.Replace(Text.Replace([Name],"š","sz"),"č","cz")),
#"Sorted Rows" = Table.Sort("Added Custom",{{{"Custom", Order.Ascending}})
一旦您排序,就可以删除该列。
答案 1 :(得分:0)
我使用了你的逻辑Alexis但添加了一个步骤 - 降低了列。我也替换了更多的值。所以我发布它以防有人感兴趣。非常感谢Alexis!
#"Added Custom2" = Table.AddColumn(#"Renamed Columns", "Custom", each [Name]),
#"Lowercased Text" = Table.TransformColumns(#"Added Custom2",{{"Custom", Text.Lower, type text}}),
#"Replaced Value" = Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(Table.ReplaceValue(#"Lowercased Text","á","az",Replacer.ReplaceText,{"Custom"}),"č","cz",Replacer.ReplaceText,{"Custom"}),"ď","dz",Replacer.ReplaceText,{"Custom"}), "é","ez",Replacer.ReplaceText,{"Custom"}), "ě","ez",Replacer.ReplaceText,{"Custom"}), "í","iz",Replacer.ReplaceText,{"Custom"}), "ň","nz",Replacer.ReplaceText,{"Custom"}), "ó","oz",Replacer.ReplaceText,{"Custom"}), "ř","rz",Replacer.ReplaceText,{"Custom"}), "š","sz",Replacer.ReplaceText,{"Custom"}), "ť","tz",Replacer.ReplaceText,{"Custom"}), "ú","uz",Replacer.ReplaceText,{"Custom"}), "ů","uz",Replacer.ReplaceText,{"Custom"}), "ý","yz",Replacer.ReplaceText,{"Custom"}), "ž","zz",Replacer.ReplaceText,{"Custom"}),
#"Sorted Rows" = Table.Sort(#"Replaced Value",{{"Custom", Order.Ascending}}),
#"Removed Columns" = Table.RemoveColumns(#"Sorted Rows",{"Custom"})