HFM’s Tricks and Tips          “Retrieving metadata’s attribute: The impact on the                       rules’ performanc...
1 OverviewThe most part of rules contains “Hs” function to retrieve information about the attribute ofdimension’s members;...
2 The issue…In order to better understand the problem and lets assuming we have the two following rules: Sub RuleA()      ...
If you consider that the RuleA1 maybe the standard Calculate Routine and the RuleA2 maybe on ofyour customizing routine yo...
3 On field…The advantage of reducing the number of retrieves of attribute can improve the performance until35%. as tested ...
Upcoming SlideShare
Loading in …5
×

Hfm tricks and tips 000001

2,245 views

Published on

Published in: Economy & Finance, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,245
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
89
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Hfm tricks and tips 000001

  1. 1. HFM’s Tricks and Tips “Retrieving metadata’s attribute: The impact on the rules’ performance” Author: Fabio FioreHFM’s Tricks and Tips : “Retrieving metadata attribute: The impact on the rules’ performance” Page 1 of 5
  2. 2. 1 OverviewThe most part of rules contains “Hs” function to retrieve information about the attribute ofdimension’s members; the retrieve of User Defined attribute frequently used (e.g: Var =Hs.Account.Ud1(“Account1”) .The rules’ engine of HFM is based on series of Visual Basic library with specific dll to read/writein a portion ram memory. In order to performing the write/read actions the rules engine extract datafrom a multiple data tables creating a memory sub-cube with following key(Year/Scenario/Entity/Value/Period).The attribute of dimension are stored on a different database tables, so when we put a rule toretrieve a metadata’s attribute HFM has to join on different table while keeping in ram memory thedata necessary to execution of rules you wrote.This process increase the memory resources utilization and make slowly the execution of rule.HFM’s Tricks and Tips : “Retrieving metadata attribute: The impact on the rules’ performance” Page 2 of 5
  3. 3. 2 The issue…In order to better understand the problem and lets assuming we have the two following rules: Sub RuleA() Sub RuleB() AccList = Hs.Account.List(“Asset”,”[Base]”) AccList = Hs.Account.List(“Asset”,”[Base]”) For Each AccItem in Acclist For Each AccItem in Acclist If Hs.Account.Ud1(AccItem) = “LongTerm” then Ud1Var = Hs.Account.Ud1(AccItem) ……Action1 ….. If Ud1Var= “LongTerm” then ElseIf Hs.Account.Ud1(AccItem) = “ShortTerm” then ……Action1 ….. ……Action2 ….. ElseIf Ud1Var= “ShortTerm” thenDffd ElseIf Hs.Account.Ud1(AccItem) = “NoFlow” then ……Action2 ….. ……Action3 ….. ElseIf Ud1Var= “NoFlow” then End if ……Action3 ….. Next End if Next End Sub End sub End SubLets assuming that base account of “Asset” are 100 base accounts. In the RuleA HFM will make300 retrieves from metadata tables, in the RuleB HFM will make 100 retrieves, so: The RuleB will be executed in less time than RuleAFor sure the using of variables is one of best practice to make clear the code written, but sometimesthe beginners consultants don’t use in properly way and stop the use when the rules does not work.Lets assuming we the following code:In the RuleA1 the user would like retrieve the Ud1 attribute of current Entity in order to make a Sub RuleA1() Sub RuleA2() EntUd1 = Hs.Entity.Ud1(Hs.Entity.Member) EntUd1 = Hs.Entity.Ud1(Hs.Entity.Member) AccList = Hs.Account.List(“Asset”,”[Base]”) C1List = Hs.Custom1t.List(“Flow”,”[Base]”) For Each AccItem in Acclist For Each AccItem in Acclist If EntUd1 = “SAP” then If EntUd1 = “SAP” then ……Action1 ….. ……Action1 ….. ElseIf EntUd1= “JDE” then ElseIf EntUd1= “JDE” then ……Action2 ….. ……Action2 ….. ElseIf EntUd1= “BAAN” then ElseIf EntUd1= “BAAN” then ……Action3 ….. ……Action3 ….. End if End if Next Next Call RuleA2 End Sub End Subseries of test on a base members of “Asset” account to do different actions.In the RuleA2 the user would like retrieve again the Ud1 attribute of current entity in order to makea series of tests on a base members of “Flow” element in Custom1 dimension.Since when you join from a visual basic “sub” to another all variables will be set to “null” It seemsyou are obliged to retrieve again the Ud1 of entity decreasing the rule performance. 3 of 5
  4. 4. If you consider that the RuleA1 maybe the standard Calculate Routine and the RuleA2 maybe on ofyour customizing routine you can imagine when frequently is this situation.You can easily improve the rule if use the “pass-through” technique between multiple sub routine.In the following box you can find an example based on RuleA1 and RuleA2In this example you find the retrieves of attribute of Entity just one time while the variable“EntUd1” will be passed in RuleA2.The “pass-through” technique can very useful in the Calculation Sub routine, you can easily passthe content of variable in order to improving performance of execution of customize rules. Sub RuleA1() Sub RuleA2(EntUd1) EntUd1 = Hs.Entity.Ud1(Hs.Entity.Member) C1List = Hs.Custom1t.List(“Flow”,”[Base]”) AccList =Hs.Account.List(“Asset”,”[Base]”) For Each AccItem in Acclist For Each AccItem in Acclist If EntUd1 = “SAP” then If EntUd1 = “SAP” then ……Action1 ….. ……Action1 ….. ElseIf EntUd1= “JDE” then ElseIf EntUd1= “JDE” then ……Action2 ….. ……Action2 ….. ElseIf EntUd1= “BAAN” then ElseIf EntUd1= “BAAN” then ……Action3 ….. ……Action3 ….. End if End if Next Next End Sub Call RuleA2(EntUd1) End Sub 4 of 5
  5. 5. 3 On field…The advantage of reducing the number of retrieves of attribute can improve the performance until35%. as tested on many customers.If the execution of process unit (the combination of following dimensions Entity / Value / Scenario/ Year / Period) without the improving described is 2000 ms (2 seconds) per process unit you willhave the following execution time: (1 scenario and 1 Period)100 Entity x 6 Value members* x 2 seconds = 1200 s 20 minutesWith improving suggest you will have:100 Entity x 6 Value members * x 1,3 seconds = 780 s 13 minutes*Entity Currency, Entity Curr Adsj, Parent Currency, Parent Curr Adjs,Parent, Parent AdjsIn order to improve the performance of your rules, decrease the number of retrievinginformation from metadata tables. 5 of 5

×