I have a table to track parcel values. Each parcel will/can have 1 record for each year. I am trying to calculate the percent change for each parcel between years. I have the following fields:
Parcel # - look up from another table
Current Year - number field to enter year
Previous Year - formula field to calculate previous year
CY Key - formula field to combine Parcel # and Current Year
PY Key - formula field to combine Parcel # and Previous Year
Value - numeric field to enter parcel value for the year
PY Value - formula field that returns the Value of the record where the CY Key equals the PY Key
I'm trying to create a % Change field formula: ((PY Value-Value)/PY Value)*100
The issue is, I think, the field types. The "Key" formula fields are Text fields, but the values I want to return are/should be numeric. So my formula for the PY Value is:
ToText(GetFieldValues(GetRecords("{143.EX.'"&[PY Key]&"'}"), 11)).
This formula correctly returns the PY Value (yay), but it is in a text field type. So in my % Change formula field I know I need to convert the values back to numbers but the formula below returns no results:
(ToNumber([PY Value])-[Value])/(ToNumber([PY Value]))*100
When I try just:
(ToNumber([PY Value])-[Value])
I do correctly get the difference between the two value fields, but as soon as I attempt to add any additional operations, the field returns no results.
Any idea of what I'm doing wrong in my formula so that I can get the percent change between the Value and PY Value fields?