View VMF_IssueTrackingAssetValue

Card of view VMF_IssueTrackingAssetValue

Name

VMF_IssueTrackingAssetValue

Comment

See MF_IssueTrackingAssetValue. This view adds a calculated MF_AssVal_BookValue field and a replacement date.

The grain of this view is different from that of the underlying table. The grain here is asset + fiscal year. Because the fiscal year is an essential element (it forms part of the logical primary key for this view), we must exclude assets for which the fiscal year can't be calculated. That is, we must exclude assets without a purchase date.

This view looks out three years ahead. That is, we can project things like the market value of current assets (with depreciation factored in) three years out. Obviously we can't predict what else new we'll buy over that time period.

Warning: If you do any reporting off of this view, and you don't filter or break the data out by fiscal year, your numbers will be wrong (inflated), because they will combine multiple years!

Note that this view is fairly complex, because it takes the flat MF_IssueTrackingAssetValue table and expands it out, with depreciation caculated in. The way Carleton currently insures equipment makes it unnecessary to factor in depreciation. But it can be useful, for planning purposes (or in case we want to change how we insure ourselves) to have figures available that factor in depreciation.

Dimensional Type

Fact


SQL query of the view VMF_IssueTrackingAssetValue

SELECT
-- In practice the AssetID, IssueTrackingSystem, and MD_Date_DateIntegerFY are the business key
itav.MF_AssVal_AssetID,
itav.MF_AssVal_IssueTrackingSystem,
itav.MD_ITAsset_SurrogateKey,
itav.MD_ITUser_SurrogateKey,
itav.MD_Building_SurrogateKey,
itav.MD_Room_SurrogateKey,
itav.MD_CarlDept_SurrogateKey,
itav.MD_CollPers_SurrogateKeyEmp,
itav.MD_CollPers_SurrogateKeyDStu,
itav.MD_Date_PurchaseDate,
CASE
WHEN itav.MD_Date_PurchaseDate IS NULL OR itav.MD_Date_PurchaseDate >= 99990000 THEN 99991231
WHEN ita.Cycle IS NULL OR ita.Cycle >= 99 THEN 99991231
ELSE itav.MD_Date_PurchaseDate + (ita.Cycle * 10000)
END AS MD_Date_ReplacementDate,
itav.MD_Date_DisposalDate,
-- Allows join to VMD_FiscalYear
mdd.MD_Date_DateInteger AS MD_Date_DateIntegerFY,
itav.MF_AssVal_CarletonCost,
CASE
WHEN d.MD_Date_FiscalYear IS NULL THEN NULL
WHEN mdd.MD_Date_FiscalYear IS NULL THEN NULL
WHEN d.MD_Date_FiscalYear <= 1900 THEN NULL
WHEN mdd.MD_Date_FiscalYear >= 9999 THEN NULL
ELSE mdd.MD_Date_FiscalYear - d.MD_Date_FiscalYear
END AS MF_AssVal_AgeInFiscalYears,
CAST(CASE
WHEN d.MD_Date_FiscalYear IS NULL THEN NULL
WHEN mdd.MD_Date_FiscalYear IS NULL THEN NULL
WHEN d.MD_Date_FiscalYear <= 1900 THEN NULL
WHEN mdd.MD_Date_FiscalYear >= 9999 THEN NULL
WHEN itav.MF_AssVal_CarletonCost IS NULL THEN NULL
-- If Cycle is <= 0 then the asset is worth nothing, because Cycle = 0 means it should be disposed of
WHEN ita.Cycle = 0                              THEN .05 * itav.MF_AssVal_CarletonCost
WHEN ita.Cycle < 0                              THEN 0
-- If an asset is > Cycle (default = 5) years old, it's worth nothing (evens out, because if we wait it'll be worth less than zero [salvage cost])
WHEN (mdd.MD_Date_FiscalYear - d.MD_Date_FiscalYear) > ISNULL(ita.Cycle, 5) THEN 0
ELSE
-- Book value = original value - cumulative depreciation
-- Cumulative depreciation = (original cost - salvage value) divided by Cycle (default = 5 years), multiplied by the age in fiscal years
-- Salvage value is assumed to be 5% of the original value
itav.MF_AssVal_CarletonCost - (
((itav.MF_AssVal_CarletonCost - (.05 * itav.MF_AssVal_CarletonCost)) / ISNULL(ita.Cycle, 5))
* (mdd.MD_Date_FiscalYear - d.MD_Date_FiscalYear))
END AS NUMERIC(18,2)) AS MF_AssVal_BookValue,
itav.MF_AssVal_CostCenter,
itav.MF_AssVal_CountWithKnownCost,
itav.MF_AssVal_Count
FROM
MF_IssueTrackingAssetValue itav
INNER JOIN (
    SELECT
    MD_ITASSET_SURROGATEKEY,
    CASE
    WHEN MD_ITAsset_YearsUntilReplacement >= 99 THEN NULL
    ELSE MD_ITAsset_YearsUntilReplacement
    END AS Cycle
FROM
       MD_ISSUETRACKINGASSET
) ita
ON itav.MD_ITASSET_SURROGATEKEY = ita.MD_ITASSET_SURROGATEKEY
-- Get fiscal year of original purchase
LEFT OUTER JOIN MD_Date d
-- VMD_FiscalYear contains only days in MD_Date that end fiscal years
ON d.MD_Date_IsLastDayOfFiscalYear = 'Yes'
AND itav.MD_Date_PurchaseDate <= d.MD_Date_DateInteger
-- Subtracting 10000 from a date integer rolls the date integer back one year
AND itav.MD_Date_PurchaseDate > (d.MD_Date_DateInteger - 10000)
-- COMMENTED OUT BECAUSE WE WANT TO SEE ASSETS THAT ARE GONE/DISPOSED OF
-- AND ISNULL(itav.MD_Date_DisposalDate, 99991231) >= (d.MD_Date_DateInteger - 1000)
-- Get all the fiscal years from date of purchase, up through the disposal year
LEFT OUTER JOIN MD_Date mdd
-- VMD_FiscalYear contains only days in MD_Date that end fiscal years
ON mdd.MD_Date_IsLastDayOfFiscalYear = 'Yes'
-- Adding 150000 to a date integer, e.g., rolls the date integer forward fifteen years
AND mdd.MD_Date_DateInteger <= (d.MD_Date_DateInteger + 100000)
-- Subtracting 10000 from a date integer rolls the date integer back one year
AND mdd.MD_Date_DateInteger > (d.MD_Date_DateInteger - 10000)
-- COMMENTED OUT BECAUSE WE WANT TO SEE ASSETS THAT ARE GONE/DISPOSED OF
-- AND ISNULL(itav.MD_Date_DisposalDate, 99991231) > (mdd.MD_Date_DateInteger - 10000)
-- Go out three years past the present day
AND mdd.MD_Date_DateInteger <= ((YEAR(GETDATE()) * 10000) + 30630)
WHERE
itav.MD_Date_PurchaseDate IS NOT NULL


List of outgoing view references of the view VMF_IssueTrackingAssetValue

Name

Parent Table/View

ViewReference_119

VMD_CarletonDepartment (Shortcut)

ViewReference_120

VMD_IssueTrackingAsset

ViewReference_121

VMD_IssueTrackingUser

ViewReference_122

VMD_Date (Shortcut)

ViewReference_124

VMD_DegreeStudent (Shortcut)

ViewReference_125

VMD_Employee (Shortcut)

ViewReference_126

VMD_FiscalYear (Shortcut)

ViewReference_127

VMD_Room

ViewReference_128

VMD_Building


List of diagrams containing the view VMF_IssueTrackingAssetValue

Name

ViewsIssueTrackingDiagram


List of permissions of the view VMF_IssueTrackingAssetValue

Grant

User

SELECT,VIEW DEFINITION

IssueTrackingReader


List of view columns of the view VMF_IssueTrackingAssetValue

Name

Data Type

Comment

Length

MF_AssVal_AssetID

 

 

 

MF_AssVal_IssueTrackingSystem

 

 

 

MD_ITAsset_SurrogateKey

 

 

 

MD_ITUser_SurrogateKey

 

 

 

MD_Building_SurrogateKey

 

 

 

MD_Room_SurrogateKey

 

 

 

MD_CarlDept_SurrogateKey

 

 

 

MD_CollPers_SurrogateKeyEmp

 

 

 

MD_CollPers_SurrogateKeyDStu

 

 

 

MD_Date_PurchaseDate

 

 

 

MD_DATE_REPLACEMENTDATE

 

 

 

MD_Date_DisposalDate

 

 

 

MD_Date_DateIntegerFY

 

 

 

MF_AssVal_CarletonCost

 

 

 

MF_ASSVAL_AGEINFISCALYEARS

 

 

 

MF_ASSVAL_BOOKVALUE

 

 

 

MF_AssVal_CostCenter

 

 

 

MF_AssVal_CountWIthKnownCost

 

 

 

MF_AssVal_CountOfEverything