Select to view content in your preferred language

Use Arcade to Symbolize by Year

2762
4
Jump to solution
04-15-2021 06:08 AM
ZachBodenner
MVP Regular Contributor

Hello, I am trying to use an arcade expression in a Portal web map to symbolize a dataset using a date field. Here's the setup:

ArcGIS Pro map includes parcel geometry feature class, sales history table (both stored in an enterprise geodatabase). Table joined to Parcel geometry via PID field. Table related (in map) to Parcel geometry via PID field. Map published to federated portal server. Parcel layer and Sales History table layer added to web map. 

Here's the rub: In the Pro document I have the parcels symbolized by Sales Date field. All of the sales from 2021 are grouped together, 2020, and so on. When I publish though, I run into the issue that web maps don't seem to support symbolizing a date field (though why exactly is entirely beyond me). So I thought of a workaround which involved using separate parcels layers joined to the sales history table, with a definition query targeting the date field in the sales history table, such that for example the 2021 layer would have a definition query like "Tablename.SalesDate=> 2021-01-01 00:00:00"  I tried a variety of definition queries and after some research determined that I might not be possible to query a date field in a joined table?

So now I'm trying to see if I can write an arcade clause in the symbology of the actual web map that will target a date by year and symbolize appropriately, but I'm kind of at a loss. Any ideas if this is even possible?

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

You can symbolize by a date field in the web as well as anything else.

jcarlson_0-1618492576941.png

 

For grouped year values, try something like this:

 

Text($feature["sale_date"], 'Y')

 

jcarlson_1-1618492688804.png

Is the sale date only in the related table, though?

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
4 Replies
jcarlson
MVP Esteemed Contributor

You can symbolize by a date field in the web as well as anything else.

jcarlson_0-1618492576941.png

 

For grouped year values, try something like this:

 

Text($feature["sale_date"], 'Y')

 

jcarlson_1-1618492688804.png

Is the sale date only in the related table, though?

- Josh Carlson
Kendall County GIS
0 Kudos
ZachBodenner
MVP Regular Contributor

Hm, the text function was a good start, but it seems like it's just not finding all of the data. For example I know there are 1227 records of sales in 2019, but the function only finds 7, and none from 2021 for some reason. I know it's a large dataset and thus a challenge for the web map to draw, but I'm a little confused why it doesn't actually find many of them.

0 Kudos
ZachBodenner
MVP Regular Contributor

Update, I think the part at least where 2021 wasn't showing up was user error. 

0 Kudos
CrystalCowardin
Regular Contributor

Was there ever an update to this?  I don't know why Portal won't allow you to easily symbolize on a date field!  I'm working with parcel data also and when I use the expression above, it leaves out a lot of data. 

0 Kudos