Oracle® OLAP DML Reference 11g Release 2 (11.2) Part Number E1712205 


View PDF 
The DEPRSOYD function calculates the depreciation expenses for a series of assets. DEPRSOYD uses the sumofyears'digits method, as described in "Calculation Method Used by DEPRSOYD", to depreciate the assets over the specified lifetime of the assets. The starting and ending values are specified for the assets acquired in each time period.
Return Value
DECIMAL, dimensioned by all the dimensions of startexp.
Syntax
DEPRSOYD(startexp endexp n [STATUS] [{FULLHALF portionexp} [timedimension]])
Parameters
A numeric expression that contains the starting values of the assets. The startexp expression must be dimensioned by a time dimension. For each value of the time dimension, startexp contains the initial value of the assets acquired during that time period. In addition to a time dimension, startexp can also have nontime dimensions.
A numeric expression that contains the ending values of the assets. The endexp expression must be dimensioned by the same dimensions as startexp. For each value of the time dimension, endexp contains the final (or salvage) value for the assets acquired during that time period. Each value of startexp must have a corresponding endexp value. For example, when the assets acquired in 1995 have a salvage value of $200, then the value of endexp for 1995 is $200.
An INTEGER
expression that contains the depreciation lifetime of the assets. The n expression can have any of the nontime dimensions of startexp, but it cannot have a time dimension.
Specifies that DEPRSOYD should use the current status list (that is, only the dimension values currently in status in their current status order) when computing the depreciation expenses. By default DEPRSOYD uses the default status list.
(Default) Specifies that the full amount of a time period's depreciation expense is charged to the time period in which assets were acquired. Charges the full amount to all of the assets in the series.
Specifies that half of the full amount of a time period's depreciation expense is charged to the time period in which assets were acquired. Charges half the full amount to all of the assets in the series. When you specify HALF as the portion of depreciation expenses to charge to the period of acquisition, the HALF factor is applied to each period. Half of each period's full depreciation expense is rolled to the next period, and the final half period of depreciation expense takes place in the n + 1 time period. You might want to use HALF when assets are acquired during the second half of the time period.
When you want to charge the full amount for some assets and half the amount for other assets, you can supply a portionexp expression that is dimensioned by any of the nontime dimensions of startexp. The portionexp expression must be a text expression with values of FULL or HALF.
The name of the time dimension by which startexp and endexp are dimensioned.When the time dimension has a type of DAY, WEEK, MONTH, QUARTER, or YEAR, the timedimension argument is optional.
Usage Notes
Calculation Method Used by DEPRSOYD
DEPRSOYD calculates the depreciation expense for a given time period as the sum of that period's depreciation expenses for all assets in the series that are not yet fully depreciated. The first period of depreciation for an asset is the period in which it was acquired.
For each time period in the lifetime of an asset, DEPRSOYD bases the depreciation expense calculation on a specific cut of the total amount to be depreciated. The value of the cut is such that the full depreciation expense can be achieved over the lifetime of an asset by multiplying the cut by the number of time periods not yet depreciated.
For example, when the lifetime of an asset is 5 years, then DEPRSOYD calculates the cut, x, as follows.
5x + 4x + 3x + 2x + 1x = total depreciation
In this case, the cut is 1/15th of the total depreciation. When the initial asset is $1,000 and its salvage value is $100, then the total depreciation is $900.00, and x is $60 ($900/15). For the first time period, the depreciation is $300 ($60 x 5). For the second time period, the depreciation is $240 ($60 x 4) and so on.
DEPRSOYD and NA Values
When a value of startexp is NA
and the corresponding value of endexp is not NA
, an error occurs. Similarly, when a value of endexp is NA
and the corresponding value of startexp is not NA
, an error occurs.
DEPRSOYD is affected by the NASKIP option when a value of startexp and the corresponding value of endexp are both NA
. When NASKIP is YES
(the default), DEPRSOYD treats the values as zeros when calculating the depreciation expenses. When NASKIP is NO
, DEPRSOYD returns NA
for all affected time periods.
Examples
Example 773 Using DEPRSOYD to Calculate Depreciation Expenses for Assets Acquired in a Single Period
This example shows how to use DEPRSOYD to calculate depreciation expenses for assets acquired in a single time period.
The following statements create two variables called assets
and salvage
.
DEFINE assets DECIMAL <year> DEFINE salvage DECIMAL <year>
Suppose you assign the following values to the variables assets
and salvage
.
YEAR ASSETS SALVAGE    Yr95 1,000.00 100.00 Yr96 0.00 0.00 Yr97 0.00 0.00 Yr98 0.00 0.00 Yr99 0.00 0.00 Yr00 0.00 0.00
The variable assets
contains the starting value of assets acquired in 1995. The variable salvage
contains the ending value of the assets acquired in 1995.
The following statement reports the values of assets
and salvage
, and uses DEPRSOYD to calculate depreciation expenses for each year, specifying an asset lifetime of 5 years.
REPORT assets salvage W 12 HEADING 'Depreciation'  DEPRSOYD(assets salvage 5 FULL year)
This statement produces the following report.
YEAR ASSETS SALVAGE Depreciation     Yr95 1,000.00 100.00 380.00 Yr96 0.00 0.00 240.00 Yr97 0.00 0.00 180.00 Yr98 0.00 0.00 120.00 Yr99 0.00 0.00 60.00 Yr00 0.00 0.00 0.00
Example 774 Using DEPRSOYD to Calculate the Depreciation Expenses for Assets Acquired in Multiple Periods
You can also use DEPRSOYD to calculate the depreciation expenses for a series of assets. Suppose you change the values for the year 1997 in the variables assets
and salvage
to the values shown in the following report.
YEAR ASSETS SALVAGE    Yr95 1,000.00 100.00 Yr96 0.00 0.00 Yr97 500.00 50.00 Yr98 0.00 0.00 Yr99 0.00 0.00 Yr00 0.00 0.00 Yr01 0.00 0.00 Yr02 0.00 0.00
Now assets
and salvage
contain nonzero values for 1995 and for 1997.
The following statement reports asset and salvage values along with depreciation expenses for the assets. Note that the call to DEPRSOYD to calculate the depreciation expenses specifies an asset lifetime of 5 periods (in this case, years).
REPORT assets salvage W 12 HEADING 'Depreciation'  DEPRSOYD(assets salvage 5 FULL year)
This statement produces the following output.
YEAR ASSETS SALVAGE Depreciation     Yr95 1,000.00 100.00 300.00 Yr96 0.00 0.00 240.00 Yr97 500.00 50.00 330.00 Yr98 0.00 0.00 240.00 Yr99 0.00 0.00 160.00 Yr00 0.00 0.00 60.00 Yr01 0.00 0.00 30.00 Yr02 0.00 0.00 0.00
Notice that as a result of the second asset, the depreciation expenses increase in 1997. The depreciation is the total depreciation of $180.00 ($60
x
3
) for the first asset and $150.00 ($30
x
5
) for the second asset.