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 tricks and tips 000001

A Small Talk on Getting Big
A Small Talk on Getting BigA Small Talk on Getting Big
A Small Talk on Getting Big
britt
 
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
Kurmendra Singh
 
Lesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.pptLesson 4A - Inverses of Functions.ppt
Lesson 4A - Inverses of Functions.ppt
ssuser78a386
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
Qundeel
 
Data Structure
Data StructureData Structure
Data Structure
sheraz1
 
Lec 1 Ds
Lec 1 DsLec 1 Ds
Lec 1 Ds
Qundeel
 

Similar to Hfm tricks and tips 000001 (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

Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot GirlsMahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
Mahendragarh Escorts 🥰 8617370543 Call Girls Offer VIP Hot Girls
 
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
Famous Kala Jadu, Black magic expert in Faisalabad and Kala ilam specialist i...
 
Lion One Corporate Presentation May 2024
Lion One Corporate Presentation May 2024Lion One Corporate Presentation May 2024
Lion One Corporate Presentation May 2024
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
Escorts Indore Call Girls-9155612368-Vijay Nagar Decent Fantastic Call Girls ...
 
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
CBD Belapur((Thane)) Charming Call Girls📞❤9833754194 Kamothe Beautiful Call G...
 
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
2999,Vashi Fantastic Ellete Call Girls📞📞9833754194 CBD Belapur Genuine Call G...
 
Fixed exchange rate and flexible exchange rate.pptx
Fixed exchange rate and flexible exchange rate.pptxFixed exchange rate and flexible exchange rate.pptx
Fixed exchange rate and flexible exchange rate.pptx
 
W.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdfW.D. Gann Theory Complete Information.pdf
W.D. Gann Theory Complete Information.pdf
 
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
Call Girls in Benson Town / 8250092165 Genuine Call girls with real Photos an...
 
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
Virar Best Sex Call Girls Number-📞📞9833754194-Poorbi Nalasopara Housewife Cal...
 
Technology industry / Finnish economic outlook
Technology industry / Finnish economic outlookTechnology industry / Finnish economic outlook
Technology industry / Finnish economic outlook
 
Benefits & Risk Of Stock Loans
Benefits & Risk Of Stock LoansBenefits & Risk Of Stock Loans
Benefits & Risk Of Stock Loans
 
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Tilak Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Q1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdfQ1 2024 Conference Call Presentation vF.pdf
Q1 2024 Conference Call Presentation vF.pdf
 
GIFT City Overview India's Gateway to Global Finance
GIFT City Overview  India's Gateway to Global FinanceGIFT City Overview  India's Gateway to Global Finance
GIFT City Overview India's Gateway to Global Finance
 
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budgetCall Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
Call Girls Howrah ( 8250092165 ) Cheap rates call girls | Get low budget
 
Strategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate PresentationStrategic Resources May 2024 Corporate Presentation
Strategic Resources May 2024 Corporate Presentation
 
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in  Yamuna Vihar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in Yamuna Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
20240419-SMC-submission-Annual-Superannuation-Performance-Test-–-design-optio...
 

Hfm tricks and tips 000001

  • 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