Berechnung der laufenden Multiplikation
Ich habe zwei Tische
WAC table
ID wac_inc item
-- ----------------- ----
1 2.310000000000000 A
2 1.100000000000000 A
3 2.130000000000000 A
4 1.340000000000000 A
Baseline Table
item baseline
---- ------------------
A 10.000000000000000
Erwartetes Ergebni
ID wac_inc item Running_Mul
-- ----------------- ---- -----------
1 2.310000000000000 A 10.231 -- 10 * (1+(2.310000000000000/100))
2 1.100000000000000 A 10.343541 -- 10.231 * (1+(1.100000000000000/100))
3 2.130000000000000 A 10.563858 -- 10.343541 * (1+(2.130000000000000/100))
4 1.340000000000000 A 10.705413 -- 10.563858 * (1+(1.340000000000000/100))
Formula zu findenrunning_mul
ist
Baseline * (1 + (wac_inc / 100))
hier für jede Zeile vorherige ZeileRunning_Mul
Wert ist dasbaseline
und für die erste Reihebaseline
wird kommen vonbaseline table
.
Hope ich machte es klar. AFAIK wir können dies mit @ tCURSOR
aber ich willvermeide RBAR
so viel wie möglich. Kann mir jemand einen besseren Weg vorschlagen.