本帖最后由 风中的我脸 于 2024-9-30 20:28 编辑
- =LET(
- data, B1:D15,
- list, VSTACK("消费时间", MAP(DROP(CHOOSECOLS(data, 2), 1), LAMBDA(a, --TEXTJOIN("-", 1, INDEX(TEXTSPLIT(a, "-"), {3, 1, 2}))))),
- lastdate, GROUPBY(CHOOSECOLS(data, 1), list, MAX, 3, 0),
- filtertemp, MAP(SEQUENCE(ROWS(list)), LAMBDA(a, INDEX(list, a) = VLOOKUP(INDEX(data, a, 1), lastdate, 2, ))),
- FILTER(data, filtertemp)
- )
复制代码- =LET(
- listsort,VSTACK(B1:D1,SORT(B2:D15,2,1)),
- res,GROUPBY(TAKE(listsort,,1),TAKE(listsort,,-2),LAMBDA(x,@TAKE(x,1)),3,0),
- res
- )
复制代码
|