AX1392

GetFileGroupVariable function

Returns the value for a file group variable, given the variable name.

NOTE: You can use a data lookup to return the same information as a GetFileGroupVariable function. Whenever possible, it is recommended to use data lookup queries over Axiom functions for faster performance.

Syntax

GetFileGroupVariable("VariableName",FileGroupID)

Parameter Description

VariableName

The name of the variable for which to return the value. You can return the value of any file group variable, including built-in variables and user-defined variables.

FileGroupID

Optional. The database ID of the file group.

  • If you are using the function within a file that belongs to a file group (template, driver, etc.), then you can omit the ID and the current file group is assumed.
  • If you are using the function outside of a file group (such as in a report file), then you must specify a file group ID. The function GetFileGroupID can be used to return the file group ID as necessary.

All non-numeric entries must be placed in double quotation marks, unless you are using cell references to reference the text held in another cell.

Remarks

  • When using this function within a file that belongs to a file group, you may see a small performance improvement if you include the file group ID in the function rather than omitting it to assume the current file group. In this case you should have a single designated cell that uses the GetFileGroupID function to return the ID for the current file group, and then reference that cell to get the ID.

  • GetFileGroupVariable is a non-volatile function.

Examples

=GetFileGroupVariable("FileGroupYear")

This example returns the value of the built-in FileGroupYear variable, for the current file group. For example: 2020.

=GetFileGroupVariable("BudgetData",Variables!$F$32)

This example returns the value of the user-defined BudgetData table variable, as defined in the file group properties of the current file group. For example: BGT2020. In this example the file group ID is being specified by pointing to a designated cell on the Variables sheet that contains a GetFileGroupID function.

=GetFileGroupVariable("BudgetData",83)

This example returns the value of the BudgetData table variable, for the file group with ID 83. In a report file, the file group ID must be specified because there is no current file group context. In most cases the ID would not be "hard-coded" in the function as shown here—instead it would be returned via the GetFileGroupID function or from a query to a system table such as Axiom.FileGroups.

=GetFileGroupVariable("SalaryEscalator")

This example returns the value of the user-defined SalaryEscalator variable, as defined in the file group properties of the current file group. For example: .02. If the variable is defined as numeric then the value will be returned as a number; otherwise it will be returned as a string.