我有一个工作簿,其中包含按 UKey 排序的信息;我需要删除每个组中的最后一行。
在这个例子中,我需要删除第 524 行; UKey 之间的范围不固定。
我试过计算一个新列来引用前一行,但没有运气,重新排序数据并删除第一行,玩索引......
帮助!
最佳答案
此代码应该可以工作:
let
group = Table.Group(YourLastStep, "UKey", {"temp", Table.RemoveLastN}),
combine = Table.Combine(group[temp])
in
combine
请注意,如果组中有单行 - 它将被删除。如果您需要保留这一行,请使用以下代码:
let
group = Table.Group(YourLastStep, "UKey", {"temp", each if Table.RowCount(_) = 1
then _ else Table.RemoveLastN(_)}),
combine = Table.Combine(group[temp])
in
combine
关于excel - 删除组中的最后一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62069407/