Select to view content in your preferred language

Same AR as been used for a year and only changed numbers, now doesn't work

69
3
4 hours ago
LorindaGilbert
Frequent Contributor

Hello,

AR drive me nuts.  I've got AR that have been working for two years!  Have not upgraded from the same version written in (3.2.4); yet, I have only changed numbers for calculations and now all of a sudden - 'Close parenthesis expected'.  Line where it showing needing is:

if ((parea > 0) && (billclass == ""V: Vacant"") && (dor < 6647 && dor > 5399)) {
    newfee = (((parea/43560)*(12*(0.1*(12.138))))+242.76)
    }

Extra parans around the 12.138 was due to attempting to use a variable set earlier that would do the calcs to get these numbers without having to manually add them in.  But that didn't work either.  Then it continues with else if.  Again, only the 12.138 and 242.76 were changed in the line.  When checking in notepad ++, all parentheses are matched.  Checked the whole script.  All braces are matched as well.  This script was edited the same way last year as well and worked.

Thanks,

Lorinda

 

0 Kudos
3 Replies
ToddW_stl
Esri Contributor

is this your entire Attribute Rule?  please share the entire Arcade code, if you're able to.

0 Kudos
LorindaGilbert
Frequent Contributor

The line that it said was invalid was line 23, so that was all that I put in the email.

Only thing that changed was numbers from last year, mainly the 0.12138

var billclass = $feature.MultiUserType
// var eru = $feature.ERUArea
var parea = $feature.IDFParcelArea
var pimparea = $feature.ImperviousArea
var dwell = $feature.Dwellings
var dor = $feature.IDFUseCode
var newfee = $feature.NewFee
var runway = $feature.Runway
var discount = $feature.Discount
var ouswwm = $feature.PostOUSWWM

// Historical calculations below new calculations

// rate 2025 - 0.08092
// rate 2026 - 0.10115
// rate 2027 - 0.12138
// rate 2028 - 0.12745
// base per 2000 sq ft - 2000*rate per year
// base per month - (2000*rate)/12
// AG (V/G between 5400 and 6646) - base/mth*.6
// Non-AG (V/G outside of above DOR) base/mth*.4

if ((parea > 0) && (billclass == ""V: Vacant"") && (dor < 6647 && dor > 5399)) {
newfee = (((parea/43560)*(12*(0.1*(12.138))))+242.76)
}
else if ((parea > 43560) && (billclass == ""V: Vacant"") && (dor < 5400 || dor > 6647)) {
newfee = ((parea/43560)*(12*(8.092 +(0.2*12.138))))
}
else if ((parea <= 43560) && (billclass == ""V: Vacant"")) {
newfee = ((parea/43560)*(12*(8.092 +(0.2*12.138))))
}
else if (billclass == ""R: SFR"") {
newfee = (pimparea*0.12138)
}
// OIA
else if ((billclass == ""G: GOAA"") && (dor < 6647 && dor > 5399)) {
newfee = (((parea/43560)*(12*(0.1*(12.138))))+242.76) //119.88
}
// OEA
else if ((billclass == ""G: GOAA"") && (dor < 6647 && dor > 5399)) {
newfee = (((parea/43560)*(12*(0.1*(12.138))))+242.76) //119.88
}
else if ((pimparea == 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = (((parea/43560)*12)*8.092)
}
else if ((pimparea == 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = (((parea/43560)*12)*8.092)
}
else if ((pimparea - runway > 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = ((pimparea - runway)*(12*8.092)/2000)
}
else if ((pimparea - runway <= 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = (((parea - runway)/43560)*33)
}
else if ((pimparea - runway > 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = ((pimparea - runway)*(12*5.4)/2000)
}
else if ((pimparea - runway <= 0) && (billclass == ""G: GOAA"") && (dor < 5400 || dor > 6647)) {
newfee = (((parea - runway)/43560)*33)
}
else if ((billclass == ""M: MFR"") && (dwell == 1) && (ouswwm == 'N')) {
newfee = ((pimparea/dwell)*0.12138)
}
else if ((billclass == ""M: MFR"") && (dwell == 1) && (ouswwm == 'Y')) {
newfee = (((pimparea/dwell)*0.12138)*0.58)
}
else if ((billclass == ""M: MFR"") && (dwell > 1) && (ouswwm == 'N')) {
newfee = (((pimparea/dwell)*0.12138)*dwell)
}
else if ((billclass == ""M: MFR"") && (dwell >1 ) && (ouswwm == 'Y')) {
newfee = (((pimparea/dwell)*(0.12138*0.58))*dwell)
}
else if (billclass == ""L: Lake"") {
newfee = 0
}
else if ((billclass == ""A: Comm"") && (ouswwm == 'N')) {
newfee = (pimparea*0.12138)
}
else if ((billclass == ""A: Comm"") && (ouswwm == 'Y')) {
newfee = ((pimparea*0.12138)*0.58)
}
else if ((billclass == ""O: Office"") && (ouswwm == 'N')) {
newfee = (pimparea*0.12138)
}
else if ((billclass == ""O: Office"") && (ouswwm == 'Y')) {
newfee = ((pimparea*0.12138)*0.58)
}
else if ((billclass == ""D: Delete"")) {
newfee = 0
}
return newfee;

0 Kudos
ToddW_stl
Esri Contributor

Have you ever tried to use the When Arcade function?  I see some duplicate else if sections, but i'm not sure that's causing your issue.

ToddW_stl_0-1781206683066.png

 

0 Kudos