NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
HFM's Tricks and Tips: Reducing Metadata Lookups to Improve Rules Performance
1. HFM’s Tricks and Tips
“Retrieving metadata’s attribute: The impact on the
rules’ performance”
Author: Fabio Fiore
HFM’s Tricks and Tips : “Retrieving metadata attribute: The impact on the rules’ performance” Page 1 of 5
2. 1 Overview
The most part of rules contains “Hs” function to retrieve information about the attribute of
dimension’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/write
in a portion ram memory. In order to performing the write/read actions the rules engine extract data
from 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 to
retrieve a metadata’s attribute HFM has to join on different table while keeping in ram memory the
data 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. 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” then
Dffd 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 Sub
Lets assuming that base account of “Asset” are 100 base accounts. In the RuleA HFM will make
300 retrieves from metadata tables, in the RuleB HFM will make 100 retrieves, so:
The RuleB will be executed in less time than RuleA
For sure the using of variables is one of best practice to make clear the code written, but sometimes
the 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 Sub
series 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 make
a 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 seems
you are obliged to retrieve again the Ud1 of entity decreasing the rule performance.
3 of 5
4. If you consider that the RuleA1 maybe the standard Calculate Routine and the RuleA2 maybe on of
your 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 RuleA2
In 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 pass
the 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. 3 On field…
The advantage of reducing the number of retrieves of attribute can improve the performance until
35%. 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 will
have the following execution time: (1 scenario and 1 Period)
100 Entity x 6 Value members* x 2 seconds = 1200 s 20 minutes
With 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 Adjs
In order to improve the performance of your rules, decrease the number of retrieving
information from metadata tables.
5 of 5