NumBase

Gets the number of base members for the current member or for a specified member. This function can be used in these types of rules:

  • Calculation

  • Translation

  • Consolidation

  • Allocation

    Note:

    A member is a base member if it has no children (that is, it is at the end of branch in a tree hierarchy).

Syntax

HS.<Object>.NumBase("Element")
HS.Node.NumBase("S#Scenario.Y#Year.P#Period.E#Entity")
HS.<Object>.NumBase("")
HS.Custom(Dimension).NumBase(Member)

Note:

Use a blank string ("") to apply this function to the current member.

Table 11-37 Syntax for NumBase Function

Parameter Description

<Object>

One of these object keywords:

  • Account

  • Custom1...4

  • Custom (Custom Dimension Label)

  • Entity

  • Parent

  • Node

Element

Depending on the object selected, name of a valid member for one of these dimensions:

  • Account

  • Custom1...4

  • Custom

  • Entity

  • Parent

  • Node

For Account and Custom objects, you must specify the member - you cannot use a blank string.

To get the number of base members in the entire dimension, specify ALL within quotation marks, as in this example:

iAcctBase = HS.Account.NumBase("ALL")

Scenario

Name of a valid Scenario dimension member.

Year

A valid year.

Period

A valid period.

Entity

Name of a valid Entity dimension member.

You can also embed the NumBase function in the Exp function. If you embed the NumBase function, do not surround NumBase’s argument with quotation marks, as in this example:

HS.Exp "A#AverageSales = A#Sales/HS.Entity.NumBase(Regional)"

Return Value

A Long that identifies the number of base members. For Node, gets the number of active base elements of the specified member.

Note:

If a base entity appears twice in a branch, the entity is counted twice.

Example

In this example, the application contains an account named SalesAlloc that stores the average sales amount for the base entities under the Regional entity. To calculate the SalesAlloc amount, the example divides the Sales account's amount by the number of base entities under Regional.

If HS.Exp"A#SalesAlloc = A#Sales/HS.Entity.NumBase(Regional)" then
  ...
End If
If HS.Exp"ASalesAlloc = A#Sales/HS.Custom("Prod").NumBase("TotalProducts")
...
End If