Symbology based on Frequency With query layer

792
4
04-03-2020 11:13 PM
HushamMohamed
Occasional Contributor

I have a dynamic query layer (polygon) derived from feature class and SQL table.
Attribute look like:

ID

City

1

city1

2

city1

3

city1

4

city2

5

city2

6

city3

7

city4

8

city1

9

city4

10

city5

11

city2

I need to write code that reports the total count for each value and create graduated color based on the count Using Arcade or any other work around in ArcGIS Online webmap, or ArcGIS Pro.

I know that graduate color could be accomplished only with Number field, 

0 Kudos
4 Replies
XanderBakker
Esri Esteemed Contributor

Hi Husham Mohamed , 

Since you mention AGOL or ArcGIS Pro, you have a couple of options. Arcade is capable of accessing a table, do a count and return that value. However, this functionality is not available in the symbology profile. You will need an actual field in your data with the result in order to visualize on it or use the instructions in this document to do otherwise: Symbolizing Feature Class using related table values 

You can use ArcGIS Pro and schedule a field calculation to run every # time to update the field and visualize the correct data. The Field Calculation could be a relatively simple Arcade expression that reads out the number of occurrences in the table. In ArcGIS Online, you can probably use a join as described by Paul Barker in this blog: Visualizing related data with Join Features in ArcGIS Online 

HushamMohamed
Occasional Contributor

Hi Xander Bakker,

Unfortunately  this functionality is not available in the symbology profile as well as other functionalities.

I ended up re writing the SQL query  to include count field. 

Thank you, for your Help.

ArmstKP
Occasional Contributor III

 

@XanderBakker Is it possible to use Arcade to symbolize a view created in SQL Server?

When I bring in the view and click the symbology icon, I don't get the option to create an expression...

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi @ArmstKP ,

I am not sure, so I can't confirm, but based on what you are seeing I can imagine that there are restrictions with this datasource.

0 Kudos