MYOB Greentree

HideShow

  • Contents
  • Index
  • Search
 
Display results with all search words

 

gtGLActAvg


This function retrieves the average balance for a GL Account or GL Masterfile Tree Branch for a specified period range.

Company

The company code, or codes, that the period end balances are to be retrieved from. Wildcards can be used instead to return accumulated values from all companies as long as they have the same calendars and base currencies, for example, *, or a string of company codes can be entered — for example, 01, 03.

AccOrTree

The account number or name of the tree that the period information is to be searched for. The account number may include wildcards — for example, *.*.*.1010 will accumulate everything for all accounts with a 4th segment of 1010.

TreeBranch

The tree branch name. This is left empty (null) if an account is being referenced.

FromYear

The Year the information is to be found from.

FromPeriod

The period information is accumulated found from. If this parameter is set to 0 then the account's financial year opening balance is included in the result.

ToYear

If not defined, then the ToYear defaults to the same as the FromYear. If defined, period information is accumulated between the FromYear and the ToYear.

oPeriod

If not defined, and ToYear is also not defined, the ToPeriod defaults to the same as the FromPeriod. If not defined, but the ToYear is defined, the ToPeriod defaults to the same as FromPeriod less one period. If defined, period information is accumulated between the FromPeriod to the ToPeriod.

If this parameter is set to 0 then the result returned includes only the account's opening balance for the financial year. This parameter defaults to 0 if the FromPeriod is 0 and this parameter is omitted from the call. Using this feature the opening balance for the account can be retrieved by specifying the FromYear parameter and setting the FromPeriod to 0.

TransType

This determines what information is returned. Valid codes are:

  • A - all financial information is totalled and returned
  • D - all debits are totalled and returned
  • C - all credits are totalled and returned
  • Q - all unit or quantity information is totalled and returned

If this is left unspecified, the default is A.

ForeignCurrency

If True, returns the balance in the account's foreign currency. If this is left unspecified the default is false, which means the accounts local currency balance is retrieved.

CreditAccount

If True, indicates the account is normally a credit account (for example, revenue accounts) and returns credit balances as a positive number.

Search

If it contains anything then this may be a string denoting filtering options — for example:

= MAS.AK.SLS.* or > MAS.AK.SLS.1010,< MAS.AK.SLS.2000

The comma works as a logical and (OR's are not supported). Neither > nor < not work with wildcards (*).

Note: When using the search function, you must put a space after the equal sign, regardless of whether using a wildcarded or a valid segment.

YTDAvg.

If True, the calculation averages the cumulative balance at each period end in the date range. If False, the calculation averages the periodic movement at each period end in the date range.

Returns

The average general ledger account balance for the specified period(s):

If a Balance Sheet account is included in the account list to average:

 

YTDAvg=True

YTDAvg=False

From Period=0

(Opening Balance + Sum of the closing balance at each period end)/ (number of periods + 1)

(Sum of the periodic movement in each period)/(number of periods)

From Period is not equal to 0

(Sum of the closing balance at each period end)/(number of periods)

(Sum of the periodic movement in each period)/(number of periods)

For example, an Asset account has these balances (assuming a June Year End):

 

Opening Balance

July

August

September

YTD Balance

10,000

11,000

12,400

14,000

Periodic movement.

n/a

1,000

1,400

1,600

Where the user stipulates to return an average from Period 0 to September these would be the result:

 

YTDAvg=True

YTDAvg=False

From Period=0 To Period = September

(10000 + 11000 + 12400+ 14000) ÷ (3+1) = 11850.

(1000 + 1400 + 1600) ÷ 3 = 1333.33.

If the user stipulates to return an average from July to September these are the results:

 

YTDAvg=True

YTDAvg=False

From Period=July To Period = September.

(11000 + 12400+ 14000) ÷ 3 = 12466.67.

(1000 + 1400 + 1600) ÷ 3 = 1333.33.

If Profit and Loss accounts only are included in the account list to average:

 

YTDAvg=True

YTDAvg=False

From Period=0.

(Sum of the closing balance at each period end)/(number of periods)

(Sum of the periodic movement in each period)/(number of periods)

From Periodis not equal to0.

(Sum of the closing balance at each period end)/(number of periods)

(Sum of the periodic movement in each period)/(number of periods)

For example, an Expense account has these balances (assuming a June Year End):

 

Opening Balance

July

August

September

YTD Balance.

n/a.

1,000.

2,400.

4,000.

Periodic movement.

n/a.

1,000.

1,400.

1,600.

Where the user stipulates to return an average from Period 0 to September these would be the result:

 

YTDAvg=True

YTDAvg=False

From Period=0 To Period = September

(1000 + 2400+ 4000) ÷ 3 = 2466.67

(1000 + 1400 + 1600) ÷ 3 = 1333.33

Where the user stipulates to return an average from July to September these would be the result:

 

YTDAvg=True

YTDAvg=False

From Period=July To Period = September.

(1000 + 2400+ 4000) ÷ 3 = 2466.67.

(1000 + 1400 + 1600) ÷ 3 = 1333.33.

Note: Where the formula is set to Transaction Type as either D or C (for debits or credits), YTDAvg=true, and is across multiple years, and a Balance Sheet account is included, an error is returned as this is not supported.

Examples

= gtGLActBal(01, 02,MAS.AK.SLS.1010,,2003,April)

= gtGLActBal(*,MAS.AK.SLS.5020,,2003,0,2003,August)

= gtGLActBal(01,Profit and Loss,Advertising,2003,August,2003,August,,,,*.AK.FTY.*)

Errors Returned

  • Must have a Company identifier
  • Invalid Company identifier
  • Must have an Account or Tree identifier
  • Account does not exist
  • Tree does not exist
  • Tree Branch does not exist
  • Must have a FromYear
  • FromYear does not exist
  • Must have a FromPeriod
  • FromPeriod does not exist
  • ToYear does not exist
  • ToPeriod does not exist
  • ToYear is before FromYear
  • ToPeriod is before FromPeriod
  • Invalid TransType code only A, D, C or Q is allowed
  • Invalid Search String