The Trick to Adding Two Additional Customs (for a total of six) in HFM

Avatar

By
April 1st, 2014


At a recent project, I was upgrading an existing HFM application—v11.1.2.2—and I wanted to add two additional Custom Dimensions to have a total of six Customs. Also in scope for this project was to rename Custom dimension aliases and top parents names.

The existing HFM business rules were built inside Calc Manager so that is where I made the modifications.

It’s important to know that the OpenDataUnit rules have to be modified differently when you have more than the four standard Customs. To add the new customs quickly and easily, use the Data Range object instead of the Script object when utilizing OpenDataUnit because it can dynamically add the new Custom dimensions.

Sample Script

The script below is an example of how you use OpenDataUnit and the Data Range object to dynamically add new Customs.

(1)  First example, old OpenDataUnit rule written in Script object using GetItem:

Set Dataunit = HS.OpenDataUnit (“C2{TopCustom2.[Base]}.C3{TopCustom3.[Base]}.C4#[None].V#<Entity Curr Total>”)

Numitems = DataUnit.GetNumitems

For i = 0 to NumItems -1

Call DataUnit.GetItem(i, Account, ICP, Custom1, Custom2, Custom3, Custom4, Data)

‘when using C2 journals member with C3 [None], this is a Consolidations Adjustment

If (HS.Custom2.IsDescendant(“TotAdj”,Custom2) Or Custom2 = “Corp Adj”) And Custom3 = “[None]” Then

‘clear and then copy balance into specific “_ConsAdj” member

HS.Clear “A#” & Account & “.C1#” & Custom1 & “.C2#” & Custom2 & “.C3#” & Custom3 & “.C4#” & eUD3var & “_ConsAdj.I#” & ICP

HS.Exp “A#” & Account & “.C1#” & Custom1 & “.C2#” & Custom2 & “.C3#” & Custom3 & “.C4#” & eUD3var & “_ConsAdj.I#” & ICP & “=” & Data

End If

(2) Second example shows how you have to modify the OpenDataUnit rule from above to accommodate the additional Custom dimensions.  Also take into consideration member name changes to the “topmembers”:

i.         TopCustom2 is renamed to TotData

ii.         TopCustom3 is renamed to TotRptgAdj

iii.         New Custom6 dimension should be restricted on member “USDVal”

Set Dataunit = HS.OpenDataUnit (“C2{TotData.[Base]}.C3{TotRptgAdj.[Base]}.C4#[None].C6#USDVal.V#<Entity Curr Total>”)

Numitems = DataUnit.GetNumitems

For i = 0 to NumItems -1

Call DataUnit.GetItemExtDim(i, Account, ICP, sCustom, Data)

‘when using C2 journals member with C3 [None], this is a Consolidations Adjustment

If (HS.Custom2.IsDescendant(“TotAdj”,sCustom(1,1)) Or sCustom(1,1) = “CorpAdj”) And sCustom(2,1) = “[None]” Then

‘clear and then copy balance into specific “_ConsAdj” member

HS.Clear “A#” & Account & “.C1#” & sCustom(0,1) & “.C2#” & sCustom(1,1) & “.C3#” & sCustom(2,1) & “.C4#” & eUD3var & “_ConsAdj.C6#” & sCustom(5,1) & “.I#” & ICP

HS.Exp “A#” & Account & “.C1#” & sCustom(0,1) & “.C2#” & sCustom(1,1) & “.C3#” & sCustom(2,1) & “.C4#” & eUD3var & “_ConsAdj.C6#” & sCustom(5,1) & “.I#” & ICP & “=” & Data

End If

The major changes to the functions are highlighted above in red.

i.       DataUnit.GetItem is modified to DataUnit.GetItemExtDim which is a 2-column array

ii.      sCustom is the variable for all the custom dimensions members

iii.     Previously, the Hs.Clear and Hs.Exp functions were referencing the different custom dimensions member names and they

are modified as follows:

a. Custom1 is modified to sCustom(0,1) where the “0” defines the Custom1 dimension and the “1” defines the member name within it

b. Custom2 is modified to sCustom(1,1) where the “1” defines the Custom2 dimension and the “1” defines the member name within

c. Custom3 is modified to sCustom(2,1) where the “2” defines the Custom3 dimension and the “1” defines the member name within it

d. The new item is sCustom(5,1) where the “5” defines the Custom6 dimension and the “1” defines the member name within it

 (3) In Calc Manger, I also used the Data Range object to set up an OpenDataUnit rule. And the Data Range object handles the additional Custom Dimensions better because it added the two additional dimensions automatically. The only thing I had to do was re-define/re-initialize the variables for the existing Custom dimensions and add in new ones for the additional two Customs. It appears that the application made me re-define/re-initialize the variables on the existing Custom dimensions because I changed the aliases.

i.         Custom2 had an alias change from generic “Custom2” to “DataType”

ii.         Custom3 had an alias change from generic “Custom3” to “RptgAdj”

So the Data Range object displayed the new aliases automatically but the variables that were assigned to these dimensions were blanked out so the simple solution was to add them right back into the object.  Then I defined new variables for the new Custom dimensions.  Finally, I updated my formula functions to incorporate the new Custom dimension similar to example #2 above.

 


Avatar

About TopDown Team

The TopDown Team includes members of TopDown Consulting who want to let the community know about webcasts, conferences, and other events. The team also conducts interviews on various EPM industry topics.

2 comments on “The Trick to Adding Two Additional Customs (for a total of six) in HFM”

  1. Sarah Darrer says:

    HI,
    This is a really helpful article for me and it is getting me 90% of the way to my solution.

    However I ahev 7 custom dimensions instead of 6 which is fine but I am just struggling on how to actually define sCustom as a variable. What should this be? Just a string or is there an equation I need to input?
    I am new to HFM Calc Manager so need some help please if possible.
    Regards
    Sarah

  2. Hoa Pham says:

    In EPM Calc Manager, you would not really use sCustom. You would use the Data Range function object and define your variables through it. Those variables can be strings. sCustom is really for classic rules development in a text file. Or if you use the Script function object in Calc Manager. sCustom would also be a string.

Leave a Reply

Your email address will not be published. Required fields are marked *