1 Reply Latest reply: Jun 11, 2013 3:46 AM by neels.grobler RSS

    Business Rule HFM logic

    chandu
      Hi All,

      I have simple logic, where I'm using OpenDataUnit. But I'm stuck at one point. For Ex:

      A= (B/12) * C is my calc

      B= Acc: 123456 and C1:000000
      C= Acc: abcdef and C1: strCustom1 (strCustom1 is a variable of OpenDataUnit, loops through all Custom1 which has data)
      A= Acc: 0987 anc C1:strCustom1

      So each time I've to multiply B times C where B's C1 is always 000000 and C's C1: should be driving by OpenDataUnit.

      I used write to file to check the intersection, but when I run the consolidation I cannot see the multiplication working coz B's custom1 is 000000 and C's Custom1 is for Ex: pqrstu the calculation is not happening.

      The calculation is working only if B's C1: 000000 and C's C1: 000000 and has data.

      Let me know how to resolve this.

      Edited by: Chandu on Jun 6, 2013 3:37 PM
        • 1. Re: Business Rule HFM logic
          neels.grobler

          Are you using Calculation Manager or writing this in a rules file (VBScript)? Also, can you post some of the actual code you use to do this?

           

          To me, the following should work:

          Set d = HS.OpenDataUnit("")
          For t = 0 to d.GetNumItems - 1
              d.GetItem t, a, i, c1, c2, c3, c4, c
              If a = "abcdef" Then
                  b = HS.GetCell("A#123456.I#" & i & ".C1#000000.C2#" & c2 & ".C3#" & c3 & ".C4#" & c4)
                  r = b / 12 * c
                  HS.Exp "A#0987.I#" & i & ".C1#" & c1 & ".C2#" & c2 & ".C3#" & c3 & ".C4#" & c4 & " = " & r
              End If
          Next