Using Arcade to Display Multi Criteria Symbology

1381
10
10-16-2019 01:17 PM
DanielZhang2
New Contributor II

Hi all!

So, I'm very new to the world of Arcade, and I'm trying to display data based off of two main attributes.

$feature.Status denotes if and when a point has been inspected. (i.e. Inspected - 2019 (Incomplete) )

$feature.tmpCondition denotes the quality of the point, ranging from poor to excellent.

I'm trying to develop a custom arcade expression to display this logic.

If status is "to be inspected", label as "to be inspected".

If tmpCondition is any of {poor, below minimum tolerable, unknown} AND status is any of {2017, 2018 complete, 2018 incomplete), label as "reinspect".

If tmpCondition if any of {poor, below minimum tolerable, unknown}, AND status is {2019 complete}, label as "inspected - 2019 (fail)".

If status is {2019 incomplete}, label as "Inspected - 2019 (Incomplete)". 

If status is any of {2019 complete, 2018 complete, 2018 incomplete, 2017}, label as "Inspected - 2019 (Pass)".

If it doesn't fit in any of these, label as "to be reviewed". 

Here's what I've got for code so far - I know well in advance it is not correct.

When( $feature.Status== ‘To Be Inspected’, ‘To Be Inspected’,

$feature.tmpCondition== ‘Poor’ || ‘Below minimum tolerable' || 'Unknown' && $feature.Status== ‘Inspected – 2017’ || ‘Inspected – 2018 (Complete)’ || ‘Inspected – 2018 (Incomplete)’, ‘Reinspect’

$feature.Status== ‘Inspected – 2019 (Complete)’ && $feature.tempCondition== ‘Poor’ || ‘Below minimum tolerable’, ‘Inspected – 2019 (Fail)’,

$feature.Status== ‘Inspected – 2019 (Incomplete)’, ‘Incomplete – 2019’,

$feature.Status== ‘Inspected – 2019 (Complete)’ || ‘Inspected – 2018 (Complete)’ || ‘Inspected – 2018 (Incomplete)’ || ‘Inspected – 2017’, ‘Inspected (Pass, 2019)’,

'to be reviewed' )

Thanks in advance, I'm really stuck here.

10 Replies
KenBuja
MVP Esteemed Contributor

Start testing your code in segments and once each condition returns the correct result, add it to the When statement.

It's probably best to write down all your expected combinations and edit the attributes of the first several rows in your data to reflect these combinations. That way it's easy to find them when you have to return them to their default attributes.