フォーマットのデータがある場合;
Account | Period | Values
Revenue | 2013-01-01 | 5432
Revenue | 2013-02-01 | 6471
Revenue | 2013-03-01 | 7231
Costs | 2013-01-01 | 4321
Costs | 2013-02-01 | 5672
Costs | 2013-03-01 | 4562
そして、次のような結果を得たいです。
Account | Period | Values
Margin | 2013-01-01 | 1111
Margin | 2013-02-01 | 799
Margin | 2013-03-01 | 2669
M% | 2013-01-01 | .20
M% | 2013-02-01 | .13
M% | 2013-03-01 | .37
ここで、マージン = 収益 - コスト、M% は各期間の (収益 - コスト)/収益です。
これを達成するさまざまな方法を見ることができますが、すべてが非常に醜いので、この種の複数行の計算に対するエレガントな一般的なアプローチがあるかどうかを知りたいと思いました。
ありがとう
編集
これらの計算のいくつかは、次のように非常に複雑になる可能性があります
フリー キャッシュ フロー = マージン - 運営費 - 設備投資 + 運転資本の変化 + 支払利息
したがって、多くの結合を必要としない一般的な方法を望んでいます。
ありがとう