Forum Stats

  • 3,853,602 Users
  • 2,264,244 Discussions
  • 7,905,405 Comments

Discussions

Dynamic Calc in HFM

SantoshRaj
SantoshRaj Member Posts: 8
edited Mar 22, 2010 9:43AM in Financial Consolidation
Hi ,
I am new to HFM and am trying to modify rules to be able to calculate Volume/day. I have created a new Balance type account "days"( Iscalc and IsConsol set to No) to store the number of days. I have loaded data for this member for Entity none and none custom. I am trying to reference this in the Sub Dynamic but its not getting any value for any intersection. Any help is greatly appreciated.

Sub Calculate()

If pov_value = "<Entity Currency>" and pov_entity <> "[None]" Then

HS.Exp "A#days = A#days .E#[None]"

End If


Sub Dynamic()

HS.Dynamic "A#Volperday = A#xxxxx1 / A#days "

End Sub


Thanks
San
Tagged:

Best Answer

  • KostasN.
    KostasN. Member Posts: 547 Silver Badge
    Answer ✓
    The problem is that you base your dynamic calculation on a normal calculation. A#days is a calculated account. Dynamic calculations cannot use calculated accounts as input, only input accounts are allowed. Move the calculation to the normal calculation rule using HS.Exp instead of HS.Dynamic and also don't forget to change Volperday from Dynamic to balance in your metadata.
«1

Answers

  • 758188
    758188 Member Posts: 58
    Dear San,

    I guess data for your 3 accounts must be on the same POV (Entity / Year / Period).

    If you want your calculation works, you must input data on Entity [None] for account A#xxxxx1.

    Regards,

    Lionel.
  • Hi Lionel,

    Thanks for your response. I am trying to copy "days" from entity none to the current POV in the Sub Calculate() to make sure that they both are on the same POV but for some reason it is not copying or I might be doing something in referencing that in Sub Dynamic().

    Thanks in Advance
    San
  • I am not getting what exactly you are trying to do, but try commenting or removing the If statement.

    Hope this is helpful
    Varun
  • KostasN.
    KostasN. Member Posts: 547 Silver Badge
    Answer ✓
    The problem is that you base your dynamic calculation on a normal calculation. A#days is a calculated account. Dynamic calculations cannot use calculated accounts as input, only input accounts are allowed. Move the calculation to the normal calculation rule using HS.Exp instead of HS.Dynamic and also don't forget to change Volperday from Dynamic to balance in your metadata.
  • 712596
    712596 Member Posts: 56
    I totally agree with Kostasn's reply. This should help

    Rgds
    Payous999
  • Hi kostasn,

    The problem I was having in making the Volperday a Balance Type account is that is not calculating at the QTD and YTD level. Lets suppose for 2009

    Jan = 31 days Vol = 3100 Volperday = 100
    Feb = 28 days Vol = 2800 Volperday = 100
    Mar = 31 days Vol = 6200 Volperday = 200

    Expected - QTR1 = 90days vol = 12100 Volperday = 134.44
    When Volperday = Balance
    QTR1 = 90days vol = 12100 Volperday = 200

    So, I dont know whether I have to use the calculation for QTD and YTD views as well. Thanks in advance

    San
  • KostasN.
    KostasN. Member Posts: 547 Silver Badge
    In that case I usually create more than one balance accounts, each for one calculation:

    1. Volperday as is
    2. VolperdayQTD and
    3. VolperdayYTD

    and specify the appropriate calculation for each of the accounts in the rules file. It works and it is no real disturbance to my client.
    KostasN.
  • 650464
    650464 Member Posts: 6
    I'm assuming you unintentionally omitted the equal sign between pov_entity and "[None]" so I'll jump to my next observation.
    The condition to execute HS.Exp is based that you're POV_entity = [None] so your Exp call implies:

    HS.Exp "A#days.*E#[None]* = A#days.E#[None]"

    In other words, you are assigning the values of A#days.E#[None] back to A#days.E#[None]! I think you will want to remove the POV_entity = [None] condition from the if statement if the idea is to copy days data from the [None] entity to whatever entity / process unit is currently being calculated.

    Alternately, don't copy the days data to the target entity unless the days do need to be viewed by your users. Your dynamic subroutine would look like:

    Sub Dynamic()

    HS.Dynamic "A#Volperday = A#xxxxx1 / A#days.E#[None]" <-- be explicit in your source POV.. include your customs, [ICP None], etc.

    End Sub

    Hope this helps.
  • KostasN.
    KostasN. Member Posts: 547 Silver Badge
    It's the not-equal sign of VBA that cannot be displayed in this forum, not an omission of the author...
  • 650464
    650464 Member Posts: 6
    Ahh! Thanks for the update. Disregard my previous post.
This discussion has been closed.