From time to time there is a mistake in the resolution of structured items and the transfer of material hierarchies to BW. It helps the Note 1410263.
In Excel you can quickly create very complex formulas. If you want to simplify your formula, you can also write your own function in VBA. Here is an example for calculating the percentage variance from the previous year.
1 2 3 4 5 |
Option Explicit Public Function prozent(source As Double, target As Double) prozent = Application.WorksheetFunction.IfError(IIf(target < 0,(source - target) / -target, (source - target) / target), 0) End Function |
As you can see, a very simple formula. For this purpose the sample as an Excel formula.
=IFERROR(IF(targetCell < 0,(sourceCell - targetCell) / - targetCell,(sourceCell - targetCell / targetCell), 0)
= (ACT) 215 - (PY) 204 / (PY) 204 = 0,055 = 5,5 %
As you can see the own formula is more readable and can be easily combined with another formula.
There is an easy way to delete the contents of an array. Is possible by the command Erase
1 2 3 4 5 6 7 8 9 10 11 |
Option Explicit Sub FeldBeispiel() Dim fFeld(5, 5) As Integer fFeld(3, 3) = 3 MsgBox fFeld(3, 3) Erase fFeld MsgBox fFeld(3, 3) End Sub |