3
7/25/2019 Open Data Unit Updated for SetDataWithPOV http://slidepdf.com/reader/full/open-data-unit-updated-for-setdatawithpov 1/3 Open Data Unit Prepared by: Danny Tijerina Advanced Technology group  Open Data Unit can be a very effective and efficient method to create rules within HFM when large amounts of data need to be processed. Open Data Unit gets the data unit to be processed and can be used in following sub routines: - Calculate - Translate - Consolidate - Allocate - User defined Sub Routine Set variables for use in the OpenDataUnit section. These variables can be customized to suit the needs of the application or client. Dim dataUnit Dim lItem Dim lNumItems Dim lView Dim destPOV Dim dData Set DataUnit  needs a view but the GetItem command does not return a view – the lView  makes sure the data is in the proper format (YTD, Periodic, QTD, Yearly) for the Scenario being  processed. lView =S.View.IDFromMember(HS.Scenario.DefaultView(HS.Scenario.Member)) Set DataUnit = HS.OpenDataUnit(“”) – This is similar to a get statement, it only processes accounts that have real data, (Note: hard zeros are considered to be real data). The double quotes “” is a call for all data being processed. This statement can be as broad or as narrow as is needed in the calculation. For example: during consolidation all data needs to be processed, but in a calculation routine you may only need a subset of the data. The less data called into Ram the more efficient your rules will be. DataUnit.GetNumItems  – This gets the actual number of records being processed. For lItem = 0 to lNumItems –1 – This takes the number of records, which starts at zero (“0”) , and subtracts one (“1”)  to get the total number to be processed. Example: When VB scripting counts items it starts at “0”, so 10 items would be stored as 0 thru 9. Call dataUnit.GetItem(lItem, strAccount, strICP, strCustom1, strCustom2, strCustom3, strCustom4, dData)  – This is the get statement for member labels . - lItem  – This is a cached list of the number of items to be processed, similar to a loop. - sAccount – Sets the variable for the account label, this is a string

Open Data Unit Updated for SetDataWithPOV

Embed Size (px)

Citation preview

Page 1: Open Data Unit Updated for SetDataWithPOV

7/25/2019 Open Data Unit Updated for SetDataWithPOV

http://slidepdf.com/reader/full/open-data-unit-updated-for-setdatawithpov 1/3

Open Data UnitPrepared by: Danny Tijerina

Advanced Technology group 

Open Data Unit can be a very effective and efficient method to create rules within HFM whenlarge amounts of data need to be processed.

Open Data Unit gets the data unit to be processed and can be used in following sub routines:

- Calculate- Translate- Consolidate

- Allocate- User defined Sub Routine

Set variables for use in the OpenDataUnit section. These variables can be customized to suit the

needs of the application or client.Dim dataUnit

Dim lItem

Dim lNumItemsDim lView

Dim destPOV

Dim dData 

Set DataUnit needs a view but the GetItem command does not return a view – the lView makessure the data is in the proper format (YTD, Periodic, QTD, Yearly) for the Scenario being processed. 

lView =S.View.IDFromMember(HS.Scenario.DefaultView(HS.Scenario.Member))

Set DataUnit = HS.OpenDataUnit(“”)  – This is similar to a get statement, it only processesaccounts that have real data, (Note: hard zeros are considered to be real data). The double quotes

“” is a call for all data being processed. This statement can be as broad or as narrow as is neededin the calculation. For example: during consolidation all data needs to be processed, but in a

calculation routine you may only need a subset of the data. The less data called into Ram themore efficient your rules will be.

DataUnit.GetNumItems – This gets the actual number of records being processed.

For lItem = 0 to lNumItems –1 – This takes the number of records, which starts at zero (“0”),and subtracts one (“1”)  to get the total number to be processed. Example: When VB scriptingcounts items it starts at “0”, so 10 items would be stored as 0 thru 9.

Call dataUnit.GetItem(lItem, strAccount, strICP, strCustom1, strCustom2, strCustom3, strCustom4, dData)  – This is the get statement for member labels .

- lItem – This is a cached list of the number of items to be processed, similar to a loop.- sAccount – Sets the variable for the account label, this is a string

Page 2: Open Data Unit Updated for SetDataWithPOV

7/25/2019 Open Data Unit Updated for SetDataWithPOV

http://slidepdf.com/reader/full/open-data-unit-updated-for-setdatawithpov 2/3

- sICP – Sets the variable for the ICP label, this is a string- sCustom1 - 4 – Sets the variable for the Custom dimension members, this is a string

- dData – This is the actual value for the data

call dataUnit.GetItemIDs2(lItem, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, dData)

 – This is the get statement for member signatures .- lItem – A cached list of the number of items to be processed, similar to a loop

- lAccount  – Sets the variable for the account signature, this is a system assignedvalue

- lICP – Sets the variable for the ICP signature, this is a system assigned value- lCustom1 – 4  – Sets the variable for the Custom dimension signatures, this is asystem assigned value

- dData – The actual value for the data, this is the same value as the one produced bythe “call dataUnit.GetItem” statement

Examples of HS.OpenDataUnit(“”):

1. This statement calls all members of the data unit:

Set dataUnit = HS.OpenDataUnit(“ ”)

2. This statement limits the number of accounts to the designated account list.

AccountList = HS.Account.List("", "Account List")For AccountLoop = LBound(AccountList) To UBound(AccountList)

AccoutsToProcess = AccountList (AccountLoop)'Set the variable AccountsToProcess as the account label

Set dataUnit = HS.OpenDataUnit("A#" & AccountsToProcess)

3. To further restrict the size of the data unit for the above statement you can include specificCustom members

Set dataUnit = HS.OpenDataUnit("A#" & AccountsToProcess & “.C1#Member1)

Once inside the Open Data Unit there are numerous options at your disposal. Here is where youcan use your imagination to create dynamic rules based on various parameters.

Examples: Filter by a specified User Defined value

Compare label stringsProcess accounts that start with a specified character

AccountUD1 = HS.AccountUD1(sAccount) – Sets a variable to be the UserDefined1 field fromaccounts. The variable “sAccount” is pulled from the OpenDataUnit, basically a loop through all

accounts with data.

Page 3: Open Data Unit Updated for SetDataWithPOV

7/25/2019 Open Data Unit Updated for SetDataWithPOV

http://slidepdf.com/reader/full/open-data-unit-updated-for-setdatawithpov 3/3

AccountID =  HS.Account.IDFromMember(“Account1”)  – Gets the signature from theaccount label. This will be passed as the destination account in the “HS.SetData” command.

Custom1ID = HS.Custom1.IDFromMember("C1Member1")

Custom2ID = HS.Custom2.IDFromMember("C2Member2")

Custom3ID = HS.Custom3.IDFromMembe r("C3Member10") – Gets the signature (systemassigned value) from the various Custom members to be passed to the destination customs in the

HS.SetData command.

Examples of HS.SetData: (this function uses the member signatures)

In this example the destination account is replaced with the variable “AccountID” representing

“Account1”. All Custom members remain the same.

Call HS.SetData(lView, AccountID, lICP, lCustom1, lCustom2, lCustom3, lCustom4, dData, True) 

In this example the destination account is replaced with the variable “AccountID” representing

“Account1” and custom 1 is replaced with the variable “Custom1ID” representing“C1Member1”. Custom 2 through 4 remain unchanged.

Call HS.SetData(lView, AccountID, lICP, Custom1ID, lCustom2, lCustom3, lCustom4, dData, True) 

Note: The call HS.SetData with a value of “True” at the end will accumulate the various accountvalues, a value of “False” will not accumulate.

Examples of HS.SetDataWithPOV: (this function uses the member labels)

Set a variable “sPOV” for use in the HS.SetDataWithPOV rule:sPOV = "A#" & sAcct & ".I#" & sICP & ".C1#" & sC1 & ".C2#" & sC2 & ".C3#" & sC3 & ".C4#" & sC3

ORsPOV = "A#Acct1.I#[ICP None].C1#[None].C2#[None].C3#[None].C4#[None]" 

Call HS.SetDataWithPOV(sPOV,dData,True) 

- sPOV – Variable set for the point of view to write back to the database- dData – Data value pulled in by the HS.SetData function- True – Value set to accumulate

Note: The call HS.SetData with a value of “True” at the end will accumulate the various accountvalues, a value of “False” will not accumulate.