Forum Discussion

EmberKrumwied's avatar
EmberKrumwied
Qrew Captain
2 months ago

Percent Formula Help

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: Parce...
  • EmberKrumwied's avatar
    2 months ago

    I figured this out on my own.  :) I couldn't understand why a similar use of the GetFieldValues formula worked on a different number field but wouldn't work on a currency field. I could only get the formula to work on the currency field if it was put into a text formula field. All attempts to simply convert the displayed value in the text field to a number resulted in displaying 0 or was blank. 

    I did notice that the text formula field would correctly display the located value but the GetFieldValues must act more like a snapshot of the matched field vs pulling the raw value. So what I was getting as a result was the number preceded by a $ (since my source field is formatted as currency it displays with the $) vs the raw actual number. So...

    I searched for a way to remove the leading $ and updated my formula text field. The results was the raw number that then I could successfully convert to a number field. Since I like to have as few fields as necessary I then played with the formula so that I could place it into a numeric formula field and save myself a step.

    Below is the final formula I used for any who are interested or may run into this issue themselves.

    Formula - numeric field formatted as Currency:
    var text PYValue =
    ToText(GetFieldValues(GetRecords("{143.EX.'"&[PY Key]&"'}"), 11));
    ToNumber(Left($PYValue,"$")& Right($PYValue,"$")))