如何在「支出」值和「從最老到最新」之後出現空行時彙總「訂單」?SUM基於關鍵標準
電流輸出:
Date | Product | Spend | Orders
------------------------------------------------
2017-09-18 Product A NULL 7
2017-09-11 Product A NULL 7
2017-09-04 Product A 1000.00 16
2017-08-28 Product A NULL 7
2017-08-21 Product A 2000.00 35
2017-08-14 Product A 1000.00 20
2017-08-07 Product A NULL 3
2017-07-31 Product A NULL 3
2017-07-24 Product A 1000.00 14
所需的輸出:
Date | Product | Spend | Orders | SUMMED Orders
---------------------------------------------------------------
2017-09-18 Product A NULL 7 NULL
2017-09-11 Product A NULL 7 NULL
2017-09-04 Product A 1000.00 16 30 (16 + 7 + 7)
2017-08-28 Product A NULL 7 NULL
2017-08-21 Product A 2000.00 35 42 (35 + 7)
2017-08-14 Product A 1000.00 20 20 (20)
2017-08-07 Product A NULL 3 NULL
2017-07-31 Product A NULL 3 NULL
2017-07-24 Product A 1000.00 14 20 (14 + 3 + 3)
我寫的數學表達式中具有總訂單欄,顯示我怎麼想出了新的總。
謝謝。
看來你按正確的順序排序? –
@ TedatORCL.Pro我更正了日期以匹配。謝謝 –