|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
呃。。。。貌似一个Table.Group即可搞定
- let
- Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZPBbcMwDEVXCXxOYfKTlClu4XOQbZpJMkYHasaI3ENjKZbdAjoI0HvSJwldLgOEiT9szqwYzsP31+fjfiMpWxBktBH5ZGEpOA3X85pPvs37CRJKwbISvAignsApRAJoBMldgYMQak0kyEtIVQnsYRTk9QvTEU8Nv4NrLl2q8xi4K6QARTmvK+bpwOC25MkODFqHkmXOv/zPxCte3nnd48v9up6azlm8m0eWnvJU3y/9/LI0lVDz6RVHaxxbOIz2BA9u8rvuCWJ/D+SBf+UpfFnl11yf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Material = _t, User = _t, Datetime = _t]),
- #"Changed Type" = Table.TransformColumnTypes(Source,{{"Material", type text}, {"User", type text}, {"Datetime", type datetime}}),
- Grouped = Table.Combine(
- Table.Group(#"Changed Type", {"User","Datetime"}, {"Grp", each let dt = [Datetime]{0} in Table.ReplaceValue(_, each [Datetime], dt, Replacer.ReplaceValue, {"Datetime"})}, 0, (x,y) => Byte.From(x[User]<>y[User] or x[Datetime]-y[Datetime]>#duration(0,0,20,0)))[Grp]
- )
- in
- Grouped
复制代码
|
|