Good morning,
I try to create a code with arcade, allowing to create a dat value according to several conditions.
I have a tree data that contains fields not_diag, periodicity, date_diag and maj_previsionnel which is the field where the value should appear.
if the not_diag field is not empty and the periodicity includes 1 then maj_previsionnel=date_diag +1 year
So make this condition on the four periodicity values.
I wrote the code this way below. The problem is that it doesn’t display anything, so I don’t know if it works or not.
HELP 😃
If($feature["note_diag"]!="" && $feature.periodicite=="1") {
return ($feature["maj_previsionnelle"])= Dateadd($feature["date_diag"],1,'years');
}
else{
If($feature["note_diag"]!="" && $feature.periodicite=="2") {
return (maj_previsionnelle)= Dateadd($feature["date_diag"],2,'years');
}
else{
If($feature["note_diag"]!="" && $feature.periodicite=="3") {
return ($feature["maj_previsionnelle"])= Dateadd($feature["date_diag"],3,'years');
}
else{
If($feature["note_diag"]!="" && $feature.periodicite=="4") {
return ($feature["maj_previsionnelle"])
= Dateadd($feature["date_diag"],4,'years');
}
}}}