我正在使用 Google 表格中的数据集,需要根据特定条件对其进行转换。鉴于下面的输入,如果在“进一步细分?”中找到“是”,我的目标是将行分解为另一张表中的多行。柱子。此外,如果“日期,如果不同”列为空,则应使用“时间戳”列中的日期。最后,输出应按日期排序。
请注意,列表将会增长:
时间戳 | 日期(如果不同) | 总成本 | 购买类型? | 店铺名称 | 描述 | 收据 | 进一步崩溃? | 成本 | 购买类型? | 描述 | 进一步崩溃? | 成本 | 购买类型? | 描述 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024年8月4日21:05:14 | 2054 | 牛 | 农民第一 | 17 牛 | 是的 | 893.65 | 羊 | 3只羊 | 是的 | 630 | 山羊 | 7 只山羊 | ||
2024年8月4日21:06:15 | 893 | 牛 | 内陆地区 | 4头牛 | example.com | |||||||||
2024年8月4日21:08:17 | 2024年6月4日 | 832 | 羊 | 西部出 | 9只羊 | example.com | 是的 | 9302 | 山羊 | 1000只山羊 | 没有 |
制作此输出:
| Date | Cost | Category | Company | Receipt | Description |
|------------|--------|----------|--------------|-------------|-------------|
| 06/04/2024 | 832 | Sheep | Western Out | example.com | 9 sheep |
| 06/04/2024 | 9302 | Goats | Western Out | example.com | 1000 goat |
| 08/04/2024 | 893 | Cattle | Outbacks | example.com | 4 cattle |
| 08/04/2024 | 2054 | Cattle | Farmers First| | 17 Cattle |
| 08/04/2024 | 893.65 | Sheep | Farmers First| | 3 sheep |
| 08/04/2024 | 630 | Goats | Farmers First| | 7 goats |
您可以尝试:
=sort(ifna(let(Σ,if(len('Form responses 1'!B2:B),'Form responses 1'!B2:B,int('Form responses 1'!A2:A)), Λ,vstack(hstack(Σ,'Form responses 1'!C2:D,'Form responses 1'!F2:F,'Form responses 1'!E2:E,'Form responses 1'!G2:G), hstack(Σ,'Form responses 1'!I2:K,'Form responses 1'!E2:E,'Form responses 1'!G2:G), hstack(Σ,'Form responses 1'!M2:O,'Form responses 1'!E2:E,'Form responses 1'!G2:G)), filter(choosecols(Λ,1,2,3,5,6,4),index(Λ,,2)<>""))),1,1,5,1,4,1)