SlideShare a Scribd company logo
1 of 5
Download to read offline
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
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
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
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
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

More Related Content

Similar to HFM's Tricks and Tips: Reducing Metadata Lookups to Improve Rules Performance

The Ring programming language version 1.5.3 book - Part 26 of 184
The Ring programming language version 1.5.3 book - Part 26 of 184The Ring programming language version 1.5.3 book - Part 26 of 184
The Ring programming language version 1.5.3 book - Part 26 of 184Mahmoud Samir Fayed
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightWiem Zine Elabidine
 
Think Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSThink Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSAdam L Barrett
 
A Small Talk on Getting Big
A Small Talk on Getting BigA Small Talk on Getting Big
A Small Talk on Getting Bigbritt
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 
Lesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.pptLesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.pptssuser78a386
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapKostas Tzoumas
 
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerDeep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerSpark Summit
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend MicroChun Hao Wang
 
Talk - Query monad
Talk - Query monad Talk - Query monad
Talk - Query monad Fabernovel
 
5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techoramaAli Kheyrollahi
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 DsQundeel
 
Data Structure
Data StructureData Structure
Data Structuresheraz1
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 DsQundeel
 
Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Plataformatec
 

Similar to HFM's Tricks and Tips: Reducing Metadata Lookups to Improve Rules Performance (20)

The Ring programming language version 1.5.3 book - Part 26 of 184
The Ring programming language version 1.5.3 book - Part 26 of 184The Ring programming language version 1.5.3 book - Part 26 of 184
The Ring programming language version 1.5.3 book - Part 26 of 184
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
 
Think Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSThink Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJS
 
A Small Talk on Getting Big
A Small Talk on Getting BigA Small Talk on Getting Big
A Small Talk on Getting Big
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Lesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.pptLesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.ppt
 
Python advance
Python advancePython advance
Python advance
 
Vb.net ii
Vb.net iiVb.net ii
Vb.net ii
 
Apache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmapApache Flink: API, runtime, and project roadmap
Apache Flink: API, runtime, and project roadmap
 
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerDeep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
 
Cc code cards
Cc code cardsCc code cards
Cc code cards
 
An Approach of Improvisation in Efficiency of Apriori Algorithm
An Approach of Improvisation in Efficiency of Apriori AlgorithmAn Approach of Improvisation in Efficiency of Apriori Algorithm
An Approach of Improvisation in Efficiency of Apriori Algorithm
 
RNN sharing at Trend Micro
RNN sharing at Trend MicroRNN sharing at Trend Micro
RNN sharing at Trend Micro
 
Talk - Query monad
Talk - Query monad Talk - Query monad
Talk - Query monad
 
5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama5 must have patterns for your microservice - techorama
5 must have patterns for your microservice - techorama
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Data Structure
Data StructureData Structure
Data Structure
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
 
Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010Código Saudável => Programador Feliz - Rs on Rails 2010
Código Saudável => Programador Feliz - Rs on Rails 2010
 

Recently uploaded

NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...Amil baba
 
Introduction to Health Economics Dr. R. Kurinji Malar.pptx
Introduction to Health Economics Dr. R. Kurinji Malar.pptxIntroduction to Health Economics Dr. R. Kurinji Malar.pptx
Introduction to Health Economics Dr. R. Kurinji Malar.pptxDrRkurinjiMalarkurin
 
Financial analysis on Risk and Return.ppt
Financial analysis on Risk and Return.pptFinancial analysis on Risk and Return.ppt
Financial analysis on Risk and Return.ppttadegebreyesus
 
Global Economic Outlook, 2024 - Scholaride Consulting
Global Economic Outlook, 2024 - Scholaride ConsultingGlobal Economic Outlook, 2024 - Scholaride Consulting
Global Economic Outlook, 2024 - Scholaride Consultingswastiknandyofficial
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》rnrncn29
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Commonwealth
 
Banking: Commercial and Central Banking.pptx
Banking: Commercial and Central Banking.pptxBanking: Commercial and Central Banking.pptx
Banking: Commercial and Central Banking.pptxANTHONYAKINYOSOYE1
 
Financial Preparation for Millennia.pptx
Financial Preparation for Millennia.pptxFinancial Preparation for Millennia.pptx
Financial Preparation for Millennia.pptxsimon978302
 
Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfMichael Silva
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...Amil baba
 
Guard Your Investments- Corporate Defaults Alarm.pdf
Guard Your Investments- Corporate Defaults Alarm.pdfGuard Your Investments- Corporate Defaults Alarm.pdf
Guard Your Investments- Corporate Defaults Alarm.pdfJasper Colin
 
The AES Investment Code - the go-to counsel for the most well-informed, wise...
The AES Investment Code -  the go-to counsel for the most well-informed, wise...The AES Investment Code -  the go-to counsel for the most well-informed, wise...
The AES Investment Code - the go-to counsel for the most well-informed, wise...AES International
 
INTERNATIONAL TRADE INSTITUTIONS[6].pptx
INTERNATIONAL TRADE INSTITUTIONS[6].pptxINTERNATIONAL TRADE INSTITUTIONS[6].pptx
INTERNATIONAL TRADE INSTITUTIONS[6].pptxaymenkhalfallah23
 
Market Morning Updates for 16th April 2024
Market Morning Updates for 16th April 2024Market Morning Updates for 16th April 2024
Market Morning Updates for 16th April 2024Devarsh Vakil
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGeckoCoinGecko
 
Liquidity Decisions in Financial management
Liquidity Decisions in Financial managementLiquidity Decisions in Financial management
Liquidity Decisions in Financial managementshrutisingh143670
 
cost of capital questions financial management
cost of capital questions financial managementcost of capital questions financial management
cost of capital questions financial managementtanmayarora23
 
Role of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxRole of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxNarayaniTripathi2
 
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书rnrncn29
 
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...Amil baba
 

Recently uploaded (20)

NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
 
Introduction to Health Economics Dr. R. Kurinji Malar.pptx
Introduction to Health Economics Dr. R. Kurinji Malar.pptxIntroduction to Health Economics Dr. R. Kurinji Malar.pptx
Introduction to Health Economics Dr. R. Kurinji Malar.pptx
 
Financial analysis on Risk and Return.ppt
Financial analysis on Risk and Return.pptFinancial analysis on Risk and Return.ppt
Financial analysis on Risk and Return.ppt
 
Global Economic Outlook, 2024 - Scholaride Consulting
Global Economic Outlook, 2024 - Scholaride ConsultingGlobal Economic Outlook, 2024 - Scholaride Consulting
Global Economic Outlook, 2024 - Scholaride Consulting
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
 
Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]Economic Risk Factor Update: April 2024 [SlideShare]
Economic Risk Factor Update: April 2024 [SlideShare]
 
Banking: Commercial and Central Banking.pptx
Banking: Commercial and Central Banking.pptxBanking: Commercial and Central Banking.pptx
Banking: Commercial and Central Banking.pptx
 
Financial Preparation for Millennia.pptx
Financial Preparation for Millennia.pptxFinancial Preparation for Millennia.pptx
Financial Preparation for Millennia.pptx
 
Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdf
 
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
NO1 Certified Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot,...
 
Guard Your Investments- Corporate Defaults Alarm.pdf
Guard Your Investments- Corporate Defaults Alarm.pdfGuard Your Investments- Corporate Defaults Alarm.pdf
Guard Your Investments- Corporate Defaults Alarm.pdf
 
The AES Investment Code - the go-to counsel for the most well-informed, wise...
The AES Investment Code -  the go-to counsel for the most well-informed, wise...The AES Investment Code -  the go-to counsel for the most well-informed, wise...
The AES Investment Code - the go-to counsel for the most well-informed, wise...
 
INTERNATIONAL TRADE INSTITUTIONS[6].pptx
INTERNATIONAL TRADE INSTITUTIONS[6].pptxINTERNATIONAL TRADE INSTITUTIONS[6].pptx
INTERNATIONAL TRADE INSTITUTIONS[6].pptx
 
Market Morning Updates for 16th April 2024
Market Morning Updates for 16th April 2024Market Morning Updates for 16th April 2024
Market Morning Updates for 16th April 2024
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko
 
Liquidity Decisions in Financial management
Liquidity Decisions in Financial managementLiquidity Decisions in Financial management
Liquidity Decisions in Financial management
 
cost of capital questions financial management
cost of capital questions financial managementcost of capital questions financial management
cost of capital questions financial management
 
Role of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxRole of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptx
 
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书
『澳洲文凭』买科廷大学毕业证书成绩单办理澳洲Curtin文凭学位证书
 
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
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