Based on the dummy data below how can I show only those values under `C1` as labels when let's say values of `C2` are greater than 40?
Sample data:
C1 C2 A 20 B 0 C 60 D 40 E 70 F 35 G 80 H 90 I 15
You can use this Expression
if ($feature.C2 > 40) return $feature.C1
Without too much trouble, actually! Depending on your environment, the actual locations of where you'd create the Arcade expression may change, but the basic formula is something like this:
var label = $feature.C1 var qual = $feature.C2 if (qual > 40){ return label} else { return }
You can accept more than one answer!
if ($feature.C2 > 40){ var lab = $feature.C1 } else { var lab = Null } return lab
The points are labelled with both C1 and C2 in red, and then this expression is for the black text.
Hi @KenBuja nice to hear from you, hope all is well, thank you for the super quick response 🙂. So I don't have to setup a variable first?
Hi @AlfredBaldenweck thank you for quick response, so in your code lab = C1 then how come both C1 and C2 are being returned on the map?
That's in a different label class for demonstration. The black text is what's being returned by this expression.
No, this shows the results of the one-line code. The two highlighted points show the Data field above and below 40
Thank you all 🙂 all of these work like a charm, cheers 👍
Oh that's neat and super concise wish I could accept two answers lol
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.