【发布时间】:2022-01-12 17:58:10
【问题描述】:
我有一个如下表,想根据条件填写同类别的Stage
if Stage = "Delivered" then fill down "Delivered" to all the next rows else if Stage = "Paid" then fill down "Paid" to all the next rows
| Category | Date | Stage |
|---|---|---|
| A | 2021-11-01 | Ordered |
| A | 2021-12-01 | Paid |
| A | 2022-01-01 | |
| B | 2021-08-01 | |
| B | 2021-09-01 | Ordered |
| B | 2021-10-01 | Paid |
| B | 2021-11-01 | Ordered |
| B | 2021-12-01 | Delivered |
结果应该是这样的:
| Category | Date | Stage |
|---|---|---|
| A | 2021-11-01 | Ordered |
| A | 2021-12-01 | Paid |
| A | 2022-01-01 | Paid |
| B | 2021-08-01 | |
| B | 2021-09-01 | Ordered |
| B | 2021-10-01 | Paid |
| B | 2021-11-01 | Paid |
| B | 2021-12-01 | Delivered |
有人可以帮忙吗?我真的很感激!
【问题讨论】:
-
什么是条件?
-
如果条件意味着每组然后需要dupe
-
@jezrael 也许你有一个很好的解决方案?