Select to view content in your preferred language

How to calculate a field based on attributes from two other fields?

672
4
Jump to solution
02-26-2024 07:36 AM
hannahisreeding
Emerging Contributor

Screenshot 2024-02-26 092248.png

 

I'm attempting to use Arcade to populate the length from a different field to a new field but only if that length corresponds to a certain label I have attributed in another different field.

The expression I have above does not work 😞

0 Kudos
1 Solution

Accepted Solutions
marksm_macomb
Frequent Contributor

Here is an article that will help you understand If statements a little better. Your current statement is just formatted incorrectly. It should read something like this:

If($feature.Clabel == "BFO24W"){
return $feature.ClengthFt
}

 

View solution in original post

0 Kudos
4 Replies
marksm_macomb
Frequent Contributor

Here is an article that will help you understand If statements a little better. Your current statement is just formatted incorrectly. It should read something like this:

If($feature.Clabel == "BFO24W"){
return $feature.ClengthFt
}

 

0 Kudos
hannahisreeding
Emerging Contributor

THANK YOU SO MUCH!! That worked perfectly! and thank you so much for the helpful link, hopefully someday I'll understand these expressions 😅

hannahisreeding
Emerging Contributor

Is there any way I could get the expression to recognize all attributes that begin with BFO24W, even if they have different information populated after that?

0 Kudos
marksm_macomb
Frequent Contributor

I would take a look at the discussion in this thread.

The solution from that thread will allow you to find "BFO24W" anywhere in the string, and another user suggests an idea that may limit results to where "BFO24W" is only located at the beginning of the string.

0 Kudos