WillVitale
4 days agoContributor
UD8 Member Not Working Anymore
Hello,
I previously created a UD8 member to find a max value out of a string group of data for specific accounts. It was working fine last year and when I was looking at it for our tax team, it just shows blank as the value. Can someone help me out and see if I'm missing something. We did upgrade to version 8.4 from 7.4 last year and I don't know if that caused something to not work.
Here is the UD8 codes I made. First is for the max value
Dim dAmount_1 As Decimal = api.Data.GetDataCell("T#Pov:U8#CFC_IC").CellAmount
Dim dAmount_2 As Decimal = api.Data.GetDataCell("T#PovPrior1:U8#CFC_IC").CellAmount
Dim dAmount_3 As Decimal = api.Data.GetDataCell("T#PovPrior2:U8#CFC_IC").CellAmount
Dim dAmount_4 As Decimal = api.Data.GetDataCell("T#PovPrior3:U8#CFC_IC").CellAmount
Dim dAmount_5 As Decimal = api.Data.GetDataCell("T#PovPrior4:U8#CFC_IC").CellAmount
Dim dAmount_6 As Decimal = api.Data.GetDataCell("T#PovPrior5:U8#CFC_IC").CellAmount
Dim dAmount_7 As Decimal = api.Data.GetDataCell("T#PovPrior6:U8#CFC_IC").CellAmount
Dim dAmount_8 As Decimal = api.Data.GetDataCell("T#PovPrior7:U8#CFC_IC").CellAmount
Dim dAmount_9 As Decimal = api.Data.GetDataCell("T#PovPrior8:U8#CFC_IC").CellAmount
Dim dAmount_10 As Decimal = api.Data.GetDataCell("T#PovPrior9:U8#CFC_IC").CellAmount
Dim dAmount_11 As Decimal = api.Data.GetDataCell("T#PovPrior10:U8#CFC_IC").CellAmount
Dim dAmount_12 As Decimal = api.Data.GetDataCell("T#PovPrior11:U8#CFC_IC").CellAmount
Dim dAmount_13 As Decimal = api.Data.GetDataCell("T#PovPrior12:U8#CFC_IC").CellAmount
' Create an array of the original amounts
Dim originalArray As Decimal() = New Decimal() {
dAmount_1, dAmount_2, dAmount_3, dAmount_4, dAmount_5, dAmount_6, dAmount_7, dAmount_8,
dAmount_9, dAmount_10, dAmount_11, dAmount_12, dAmount_13
}
' Create an array of absolute values
Dim absArray As Decimal() = originalArray.Select(Function(x) Math.Abs(x)).ToArray()
' Find the index of the maximum absolute value
Dim maxIndex As Integer = Array.IndexOf(absArray, absArray.Max())
' Return the original value that corresponds to the maximum absolute value
Return originalArray(maxIndex)
CFC_IC Code
Return api.Data.GetDataCell("(I#01000:U8#None + I#01200:U8#None + I#01250:U8#None + I#01900:U8#None + I#05130:U8#None + I#05140:U8#None + I#10100:U8#None + I#10110:U8#None + I#10120:U8#None + I#10130:U8#None + I#10140:U8#None + I#10150:U8#None + I#11100:U8#None + I#14100:U8#None + I#17900:U8#None + I#17910:U8#None + I#19100:U8#None + I#20100:U8#None + I#21100:U8#None + I#26100:U8#None + I#27100:U8#None)")
Thanks,
Will